<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: AS3: Removing duplicates from an array</title>
	<atom:link href="http://www.razorberry.com/blog/archives/2008/09/03/as3-removing-duplicates-from-an-array/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.razorberry.com/blog/archives/2008/09/03/as3-removing-duplicates-from-an-array/</link>
	<description>since 2004!</description>
	<lastBuildDate>Fri, 27 Aug 2010 18:22:44 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Ash</title>
		<link>http://www.razorberry.com/blog/archives/2008/09/03/as3-removing-duplicates-from-an-array/comment-page-1/#comment-3354</link>
		<dc:creator>Ash</dc:creator>
		<pubDate>Fri, 22 May 2009 13:44:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.razorberry.com/blog/?p=63#comment-3354</guid>
		<description>Thanks for your findings Aurelain. I originally posted this as an interesting snippet and made no claims for performance. In a real world application, I would definitely recommend using something a little more readable/sensible.</description>
		<content:encoded><![CDATA[<p>Thanks for your findings Aurelain. I originally posted this as an interesting snippet and made no claims for performance. In a real world application, I would definitely recommend using something a little more readable/sensible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aurelain</title>
		<link>http://www.razorberry.com/blog/archives/2008/09/03/as3-removing-duplicates-from-an-array/comment-page-1/#comment-3353</link>
		<dc:creator>Aurelain</dc:creator>
		<pubDate>Fri, 22 May 2009 10:15:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.razorberry.com/blog/?p=63#comment-3353</guid>
		<description>A note about performance:
saulo&#039;s code is about 2% faster then Razorberry&#039;s.

Also, if saulo would add variable types, the code would get a 10% performance boost. Like this:

arr.filter(function(e:*, i:int, a:Array):Boolean {return a.indexOf(e) == i;});</description>
		<content:encoded><![CDATA[<p>A note about performance:<br />
saulo's code is about 2% faster then Razorberry's.</p>
<p>Also, if saulo would add variable types, the code would get a 10% performance boost. Like this:</p>
<p>arr.filter(function(e:*, i:int, a:Array):Boolean {return a.indexOf(e) == i;});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aurelain</title>
		<link>http://www.razorberry.com/blog/archives/2008/09/03/as3-removing-duplicates-from-an-array/comment-page-1/#comment-3352</link>
		<dc:creator>Aurelain</dc:creator>
		<pubDate>Fri, 22 May 2009 10:08:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.razorberry.com/blog/?p=63#comment-3352</guid>
		<description>Razorberry&#039;s code:
- Adds the first element into the new array
- Any subsequent element gets tested whether it already exists or not. If not, pushes the element into the new array.

On the other hand, saulo&#039;s code is much more elegant:
- Each element&#039;s index is compared to the index of its first occurrence. If they&#039;re different, it means the element is not the first, thus a duplicate.</description>
		<content:encoded><![CDATA[<p>Razorberry's code:<br />
- Adds the first element into the new array<br />
- Any subsequent element gets tested whether it already exists or not. If not, pushes the element into the new array.</p>
<p>On the other hand, saulo's code is much more elegant:<br />
- Each element's index is compared to the index of its first occurrence. If they're different, it means the element is not the first, thus a duplicate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: marije</title>
		<link>http://www.razorberry.com/blog/archives/2008/09/03/as3-removing-duplicates-from-an-array/comment-page-1/#comment-3341</link>
		<dc:creator>marije</dc:creator>
		<pubDate>Thu, 16 Apr 2009 11:18:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.razorberry.com/blog/?p=63#comment-3341</guid>
		<description>It works perfectly! Wish I could understand how it works.</description>
		<content:encoded><![CDATA[<p>It works perfectly! Wish I could understand how it works.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: laku matu</title>
		<link>http://www.razorberry.com/blog/archives/2008/09/03/as3-removing-duplicates-from-an-array/comment-page-1/#comment-3318</link>
		<dc:creator>laku matu</dc:creator>
		<pubDate>Tue, 10 Mar 2009 20:45:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.razorberry.com/blog/?p=63#comment-3318</guid>
		<description>yeah, please
i only half understand it</description>
		<content:encoded><![CDATA[<p>yeah, please<br />
i only half understand it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: saicolo</title>
		<link>http://www.razorberry.com/blog/archives/2008/09/03/as3-removing-duplicates-from-an-array/comment-page-1/#comment-3313</link>
		<dc:creator>saicolo</dc:creator>
		<pubDate>Thu, 26 Feb 2009 20:14:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.razorberry.com/blog/?p=63#comment-3313</guid>
		<description>Can you explain how it works so us lames can understand whats going on? Thanks =)</description>
		<content:encoded><![CDATA[<p>Can you explain how it works so us lames can understand whats going on? Thanks =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: chet</title>
		<link>http://www.razorberry.com/blog/archives/2008/09/03/as3-removing-duplicates-from-an-array/comment-page-1/#comment-3197</link>
		<dc:creator>chet</dc:creator>
		<pubDate>Sat, 20 Dec 2008 04:30:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.razorberry.com/blog/?p=63#comment-3197</guid>
		<description>Wow, that is inline to the extreme. Nice work but it doesn&#039;t always have to be on one line :) (thanks for the function)</description>
		<content:encoded><![CDATA[<p>Wow, that is inline to the extreme. Nice work but it doesn't always have to be on one line <img src='http://www.razorberry.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  (thanks for the function)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: saulo</title>
		<link>http://www.razorberry.com/blog/archives/2008/09/03/as3-removing-duplicates-from-an-array/comment-page-1/#comment-3194</link>
		<dc:creator>saulo</dc:creator>
		<pubDate>Mon, 15 Dec 2008 19:56:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.razorberry.com/blog/?p=63#comment-3194</guid>
		<description>what about
var a:Array = [&quot;1&quot;, &quot;1&quot;, &quot;3&quot;, &quot;3&quot;];
trace(a.filter(function(e, i, a) {
	return a.indexOf(e) == i;
}, this));
?</description>
		<content:encoded><![CDATA[<p>what about<br />
var a:Array = ["1", "1", "3", "3"];<br />
trace(a.filter(function(e, i, a) {<br />
	return a.indexOf(e) == i;<br />
}, this));<br />
?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vitaLee</title>
		<link>http://www.razorberry.com/blog/archives/2008/09/03/as3-removing-duplicates-from-an-array/comment-page-1/#comment-3191</link>
		<dc:creator>vitaLee</dc:creator>
		<pubDate>Thu, 04 Dec 2008 09:06:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.razorberry.com/blog/?p=63#comment-3191</guid>
		<description>well, it&#039;s hell of a long line of code.</description>
		<content:encoded><![CDATA[<p>well, it's hell of a long line of code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon B</title>
		<link>http://www.razorberry.com/blog/archives/2008/09/03/as3-removing-duplicates-from-an-array/comment-page-1/#comment-3181</link>
		<dc:creator>Simon B</dc:creator>
		<pubDate>Thu, 23 Oct 2008 03:33:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.razorberry.com/blog/?p=63#comment-3181</guid>
		<description>Thanks for the script! 

I&#039;ve been trying all sorts of things to cut out duplicates, but I&#039;m not a programmer so it&#039;s been taking me forever!

Simon.</description>
		<content:encoded><![CDATA[<p>Thanks for the script! </p>
<p>I've been trying all sorts of things to cut out duplicates, but I'm not a programmer so it's been taking me forever!</p>
<p>Simon.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
