<?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: Comparing two arrays (or IEnumerables) in C#</title>
	<atom:link href="http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/</link>
	<description></description>
	<pubDate>Mon, 13 Oct 2008 11:28:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7-hemorrhage</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jurgen</title>
		<link>http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-118011</link>
		<dc:creator>Jurgen</dc:creator>
		<pubDate>Wed, 26 Mar 2008 06:28:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-118011</guid>
		<description>"Much to my surprise I found that .NET 3.5 doesn’t seem to have a native method for comparing two arrays or collections of any type."&lt;br&gt;&lt;br&gt;Well, I've just discovered it does : SequenceEqual&#60;TSource&#62; (see &lt;a href="http://msdn2.microsoft.com/en-us/library/bb342073.aspx"&gt;http://msdn2.microsoft.com/en-us/library/bb3420...&lt;/a&gt;) enumerates the elements and compares them.&lt;br&gt;The main difference with IsEqualTo&#60;TSource&#62; is that it throws exceptions whenever one of the IEnumerable&#60;T&#62; is null.&lt;br&gt;&lt;br&gt;However, the names of the methods are consistent :&lt;br&gt;- IsEqualTo compares the containers and their content if any.&lt;br&gt;- SequenceEqual compares the content (the sequence). Therefore the containers are supposed to exists (ie not null)&lt;br&gt;&lt;br&gt;The implementation of method SequenceEqual (seen through Reflector) :&lt;br&gt;- does not use local vars. As a result, there is one more call to MoveNext than in IsEqualTo, but the code looks straightforward in my opinion.&lt;br&gt;- reminds me you could remove try/finally and replace that with using statements. It then behaves the same but it's much more readable. (Haven't seen that !.. I must still be disturbed by the fact IEnumerator&#60;T&#62; implements IDisposable...)</description>
		<content:encoded><![CDATA[<p>&#8220;Much to my surprise I found that .NET 3.5 doesn’t seem to have a native method for comparing two arrays or collections of any type.&#8221;</p>
<p>Well, I&#8217;ve just discovered it does : SequenceEqual&lt;TSource&gt; (see <a href="http://msdn2.microsoft.com/en-us/library/bb342073.aspx"></a><a href="http://msdn2.microsoft.com/en-us/library/bb3420.." rel="nofollow">http://msdn2.microsoft.com/en-us/library/bb3420..</a>.) enumerates the elements and compares them.<br />The main difference with IsEqualTo&lt;TSource&gt; is that it throws exceptions whenever one of the IEnumerable&lt;T&gt; is null.</p>
<p>However, the names of the methods are consistent :<br />- IsEqualTo compares the containers and their content if any.<br />- SequenceEqual compares the content (the sequence). Therefore the containers are supposed to exists (ie not null)</p>
<p>The implementation of method SequenceEqual (seen through Reflector) :<br />- does not use local vars. As a result, there is one more call to MoveNext than in IsEqualTo, but the code looks straightforward in my opinion.<br />- reminds me you could remove try/finally and replace that with using statements. It then behaves the same but it&#8217;s much more readable. (Haven&#8217;t seen that !.. I must still be disturbed by the fact IEnumerator&lt;T&gt; implements IDisposable&#8230;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jurgen</title>
		<link>http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-117117</link>
		<dc:creator>Jurgen</dc:creator>
		<pubDate>Tue, 25 Mar 2008 14:28:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-117117</guid>
		<description>"Much to my surprise I found that .NET 3.5 doesn’t seem to have a native method for comparing two arrays or collections of any type."

Well, I've just discovered it does : SequenceEqual&#60;TSource&#62; (see http://msdn2.microsoft.com/en-us/library/bb342073.aspx) enumerates the elements and compares them.
The main difference with IsEqualTo&#60;TSource&#62; is that it throws exceptions whenever one of the IEnumerable&#60;T&#62; is null.

However, the names of the methods are consistent :
- IsEqualTo compares the containers and their content if any.
- SequenceEqual compares the content (the sequence). Therefore the containers are supposed to exists (ie not null)

The implementation of method SequenceEqual (seen through Reflector) :
- does not use local vars. As a result, there is one more call to MoveNext than in IsEqualTo, but the code looks straightforward in my opinion.
- reminds me you could remove try/finally and replace that with using statements. It then behaves the same but it's much more readable. (Haven't seen that !.. I must still be disturbed by the fact IEnumerator&#60;T&#62; implements IDisposable...)</description>
		<content:encoded><![CDATA[<p>&#8220;Much to my surprise I found that .NET 3.5 doesn’t seem to have a native method for comparing two arrays or collections of any type.&#8221;</p>
<p>Well, I&#8217;ve just discovered it does : SequenceEqual&lt;TSource&gt; (see <a href="http://msdn2.microsoft.com/en-us/library/bb342073.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/bb342073.aspx</a>) enumerates the elements and compares them.<br />
The main difference with IsEqualTo&lt;TSource&gt; is that it throws exceptions whenever one of the IEnumerable&lt;T&gt; is null.</p>
<p>However, the names of the methods are consistent :<br />
- IsEqualTo compares the containers and their content if any.<br />
- SequenceEqual compares the content (the sequence). Therefore the containers are supposed to exists (ie not null)</p>
<p>The implementation of method SequenceEqual (seen through Reflector) :<br />
- does not use local vars. As a result, there is one more call to MoveNext than in IsEqualTo, but the code looks straightforward in my opinion.<br />
- reminds me you could remove try/finally and replace that with using statements. It then behaves the same but it&#8217;s much more readable. (Haven&#8217;t seen that !.. I must still be disturbed by the fact IEnumerator&lt;T&gt; implements IDisposable&#8230;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glenn Slaven</title>
		<link>http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-118010</link>
		<dc:creator>Glenn Slaven</dc:creator>
		<pubDate>Thu, 20 Mar 2008 15:39:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-118010</guid>
		<description>This is why I like posting this stuff, I always learn so much!  I've updated the code</description>
		<content:encoded><![CDATA[<p>This is why I like posting this stuff, I always learn so much!  I&#8217;ve updated the code</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jurgen</title>
		<link>http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-118009</link>
		<dc:creator>Jurgen</dc:creator>
		<pubDate>Thu, 20 Mar 2008 09:21:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-118009</guid>
		<description>If you compare the IL of both versions you'll see the non-shortcurting solution is a bit smaller (uses fewer instructions : it has less branches because '&#38;&#38;' shortcut feature creates branches), but it shouldn't be really faster. What takes time on big IEnumerable&#60;T&#62; is callvirt to MoveNext(), and both versions call MoveNext as much.&lt;br&gt;&lt;br&gt;Two more remarks and I'm done/gone (and I stop bugging you !) :&lt;br&gt;A- You can remove the catch block. A try/finally is more than enough in that case.&lt;br&gt;B- Don't you want to return true also when value == compareList ? (If you do you can replace line 15 with if(value == compareList) )&lt;br&gt;&lt;br&gt;&lt;br&gt;Now you've provided your readers with an "IsEqualTo" method, I propose an exercise for their spare time : implement "StartsWith" (easy) and "EndsWith" (ouch ! seems harder) extension methods on IEnumerable&#60;&#62; ! :)&lt;br&gt;&lt;br&gt;Regards</description>
		<content:encoded><![CDATA[<p>If you compare the IL of both versions you&#8217;ll see the non-shortcurting solution is a bit smaller (uses fewer instructions : it has less branches because &#8216;&amp;&amp;&#8217; shortcut feature creates branches), but it shouldn&#8217;t be really faster. What takes time on big IEnumerable&lt;T&gt; is callvirt to MoveNext(), and both versions call MoveNext as much.</p>
<p>Two more remarks and I&#8217;m done/gone (and I stop bugging you !) :<br />A- You can remove the catch block. A try/finally is more than enough in that case.<br />B- Don&#8217;t you want to return true also when value == compareList ? (If you do you can replace line 15 with if(value == compareList) )</p>
<p>Now you&#8217;ve provided your readers with an &#8220;IsEqualTo&#8221; method, I propose an exercise for their spare time : implement &#8220;StartsWith&#8221; (easy) and &#8220;EndsWith&#8221; (ouch ! seems harder) extension methods on IEnumerable&lt;&gt; ! <img src='http://blog.slaven.net.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glenn Slaven</title>
		<link>http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-118008</link>
		<dc:creator>Glenn Slaven</dc:creator>
		<pubDate>Thu, 20 Mar 2008 04:05:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-118008</guid>
		<description>Ah, now I see it.  They Joys of working with enumerators.  I like the non-shortcuting solution, but I tend to agree with your opinion on readability over nominal performance improvement.  Besides, I speed tested both ways on a massive collection &#38; I couldn't detect any material difference.&lt;br&gt;&lt;br&gt;Thanks for your help with this, and for your patience in getting your point through!  I added in some exception handling to dispose of resources in this revision too.</description>
		<content:encoded><![CDATA[<p>Ah, now I see it.  They Joys of working with enumerators.  I like the non-shortcuting solution, but I tend to agree with your opinion on readability over nominal performance improvement.  Besides, I speed tested both ways on a massive collection &amp; I couldn&#8217;t detect any material difference.</p>
<p>Thanks for your help with this, and for your patience in getting your point through!  I added in some exception handling to dispose of resources in this revision too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jurgen</title>
		<link>http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-118007</link>
		<dc:creator>Jurgen</dc:creator>
		<pubDate>Thu, 20 Mar 2008 03:14:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-118007</guid>
		<description>Glenn,&lt;br&gt;&lt;br&gt;I'm ok to say "fi" != "fish" (no matter what order).&lt;br&gt;However, did you try "fish".IsEqualTo("fis"); ?   [or to take my example "123".IsEqualTo("12");]&lt;br&gt;I did with the latest version of the code of your post above (in .NET2.0; I removed the "this" in the method parameters). It returns true.&lt;br&gt;&lt;br&gt;When the enumerators "lengths" differ by 1 element and the extension method is run on the "bigger" enumerator, the problem arises. The sequence is the following :&lt;br&gt;A- looping on common elements. Ok.&lt;br&gt;B- enumerator2 runs out of elements (MoveNext == false) while enumerator1 points to the last element of the "bigger" enumerator.&lt;br&gt;C- the while condition is thus false. Moving to return statement.&lt;br&gt;D- enumerator2.MoveNext still remains false.&lt;br&gt;E- enumerator1.MoveNext becomes false because it's now pointing after the last element. We've sort of ignored the last element of enumerator1 (we made twice MoveNext on it : at steps B then E).&lt;br&gt;F- Return statement thus returns true.&lt;br&gt;&lt;br&gt;&lt;br&gt;To solve this issue you :&lt;br&gt;- either have to MoveNext() transactionnally both enumerators in the while condition. I don't know how to do this properly in an elegant way...&lt;br&gt;- or have to store the result of the MoveNext() as I did in the previous code I posted. These values are the states of the last calls to MoveNext(). I can therefore use them in the return statement, without "MoveNexting" the enumerator...&lt;br&gt;&lt;br&gt;&lt;br&gt;As an alternative to my code, you may also want to remove additional MoveNext() calls in the body. This gives the following code (we have here one single call MoveNext for each enumerator) :&lt;br&gt;&lt;br&gt;public static bool IsEqualTo&#60;T&#62;(IEnumerable&#60;T&#62; value, IEnumerable&#60;T&#62; compareList, IEqualityComparer&#60;T&#62; comparer)&lt;br&gt;{&lt;br&gt;/* begin of method goes here */&lt;br&gt;            else&lt;br&gt;            {&lt;br&gt;                IEnumerator&#60;T&#62; enumerator1 = value.GetEnumerator();&lt;br&gt;                IEnumerator&#60;T&#62; enumerator2 = compareList.GetEnumerator();&lt;br&gt;&lt;br&gt;                bool enum1HasValue;&lt;br&gt;                bool enum2HasValue;&lt;br&gt;                while ((enum1HasValue=enumerator1.MoveNext()) &#38; (enum2HasValue=enumerator2.MoveNext()))&lt;br&gt;                {&lt;br&gt;                    if (!comparer.Equals(enumerator1.Current, enumerator2.Current))&lt;br&gt;                    {&lt;br&gt;                        return false;&lt;br&gt;                    }&lt;br&gt;                }&lt;br&gt;                return !(enum1HasValue &#124;&#124; enum2HasValue);&lt;br&gt;            }&lt;br&gt;}&lt;br&gt;&lt;br&gt;&lt;br&gt;Note that this last snippet uses a non-short-circuiting &#38; operator in the while condition. If you short-circuit with a &#38;&#38;, you'll have a bad value in enum2HasValue whenever enumerator1 first runs out of elements.&lt;br&gt;However I only recommand this implementation if it's well documented and not subjet to frequent code review, because the use of the non-short-circuiting &#38; operator may lead to confusion or anti-optimisation ("hey, man, &#38;&#38; is cooler, because it doesn't evaluate more than needed !").&lt;br&gt;I personally wouldn't use such a cryptic implementation : the performance should be the equivalent (if not same), and readability decreases.</description>
		<content:encoded><![CDATA[<p>Glenn,</p>
<p>I&#8217;m ok to say &#8220;fi&#8221; != &#8220;fish&#8221; (no matter what order).<br />However, did you try &#8220;fish&#8221;.IsEqualTo(&#8221;fis&#8221;); ?   [or to take my example "123".IsEqualTo("12");]<br />I did with the latest version of the code of your post above (in .NET2.0; I removed the &#8220;this&#8221; in the method parameters). It returns true.</p>
<p>When the enumerators &#8220;lengths&#8221; differ by 1 element and the extension method is run on the &#8220;bigger&#8221; enumerator, the problem arises. The sequence is the following :<br />A- looping on common elements. Ok.<br />B- enumerator2 runs out of elements (MoveNext == false) while enumerator1 points to the last element of the &#8220;bigger&#8221; enumerator.<br />C- the while condition is thus false. Moving to return statement.<br />D- enumerator2.MoveNext still remains false.<br />E- enumerator1.MoveNext becomes false because it&#8217;s now pointing after the last element. We&#8217;ve sort of ignored the last element of enumerator1 (we made twice MoveNext on it : at steps B then E).<br />F- Return statement thus returns true.</p>
<p>To solve this issue you :<br />- either have to MoveNext() transactionnally both enumerators in the while condition. I don&#8217;t know how to do this properly in an elegant way&#8230;<br />- or have to store the result of the MoveNext() as I did in the previous code I posted. These values are the states of the last calls to MoveNext(). I can therefore use them in the return statement, without &#8220;MoveNexting&#8221; the enumerator&#8230;</p>
<p>As an alternative to my code, you may also want to remove additional MoveNext() calls in the body. This gives the following code (we have here one single call MoveNext for each enumerator) :</p>
<p>public static bool IsEqualTo&lt;T&gt;(IEnumerable&lt;T&gt; value, IEnumerable&lt;T&gt; compareList, IEqualityComparer&lt;T&gt; comparer)<br />{<br />/* begin of method goes here */<br />            else<br />            {<br />                IEnumerator&lt;T&gt; enumerator1 = value.GetEnumerator();<br />                IEnumerator&lt;T&gt; enumerator2 = compareList.GetEnumerator();</p>
<p>                bool enum1HasValue;<br />                bool enum2HasValue;<br />                while ((enum1HasValue=enumerator1.MoveNext()) &amp; (enum2HasValue=enumerator2.MoveNext()))<br />                {<br />                    if (!comparer.Equals(enumerator1.Current, enumerator2.Current))<br />                    {<br />                        return false;<br />                    }<br />                }<br />                return !(enum1HasValue || enum2HasValue);<br />            }<br />}</p>
<p>Note that this last snippet uses a non-short-circuiting &amp; operator in the while condition. If you short-circuit with a &amp;&amp;, you&#8217;ll have a bad value in enum2HasValue whenever enumerator1 first runs out of elements.<br />However I only recommand this implementation if it&#8217;s well documented and not subjet to frequent code review, because the use of the non-short-circuiting &amp; operator may lead to confusion or anti-optimisation (&#8221;hey, man, &amp;&amp; is cooler, because it doesn&#8217;t evaluate more than needed !&#8221;).<br />I personally wouldn&#8217;t use such a cryptic implementation : the performance should be the equivalent (if not same), and readability decreases.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glenn Slaven</title>
		<link>http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-117110</link>
		<dc:creator>Glenn Slaven</dc:creator>
		<pubDate>Wed, 19 Mar 2008 23:39:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-117110</guid>
		<description>This is why I like posting this stuff, I always learn so much!  I've updated the code</description>
		<content:encoded><![CDATA[<p>This is why I like posting this stuff, I always learn so much!  I&#8217;ve updated the code</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jurgen</title>
		<link>http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-117109</link>
		<dc:creator>Jurgen</dc:creator>
		<pubDate>Wed, 19 Mar 2008 17:21:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-117109</guid>
		<description>If you compare the IL of both versions you'll see the non-shortcurting solution is a bit smaller (uses fewer instructions : it has less branches because '&#38;&#38;' shortcut feature creates branches), but it shouldn't be really faster. What takes time on big IEnumerable&#60;T&#62; is callvirt to MoveNext(), and both versions call MoveNext as much.

Two more remarks and I'm done/gone (and I stop bugging you !) :
A- You can remove the catch block. A try/finally is more than enough in that case.
B- Don't you want to return true also when value == compareList ? (If you do you can replace line 15 with if(value == compareList) )


Now you've provided your readers with an "IsEqualTo" method, I propose an exercise for their spare time : implement "StartsWith" (easy) and "EndsWith" (ouch ! seems harder) extension methods on IEnumerable&#60;&#62; ! :)

Regards</description>
		<content:encoded><![CDATA[<p>If you compare the IL of both versions you&#8217;ll see the non-shortcurting solution is a bit smaller (uses fewer instructions : it has less branches because &#8216;&amp;&amp;&#8217; shortcut feature creates branches), but it shouldn&#8217;t be really faster. What takes time on big IEnumerable&lt;T&gt; is callvirt to MoveNext(), and both versions call MoveNext as much.</p>
<p>Two more remarks and I&#8217;m done/gone (and I stop bugging you !) :<br />
A- You can remove the catch block. A try/finally is more than enough in that case.<br />
B- Don&#8217;t you want to return true also when value == compareList ? (If you do you can replace line 15 with if(value == compareList) )</p>
<p>Now you&#8217;ve provided your readers with an &#8220;IsEqualTo&#8221; method, I propose an exercise for their spare time : implement &#8220;StartsWith&#8221; (easy) and &#8220;EndsWith&#8221; (ouch ! seems harder) extension methods on IEnumerable&lt;&gt; ! <img src='http://blog.slaven.net.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glenn Slaven</title>
		<link>http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-118006</link>
		<dc:creator>Glenn Slaven</dc:creator>
		<pubDate>Wed, 19 Mar 2008 13:47:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-118006</guid>
		<description>Jurgen, I've tested the function with different length strings &#038; it returns false as expected.  The reason is that it keeps looping until either enumerators has no more items, then it checks if both have  no more items.  If they both have no more, they're the same length, so return true.  If the other enumerator has more items then they're different lengths, so it returns false.&lt;br&gt;&lt;br&gt;Both the following tests pass:&lt;br&gt;&lt;br&gt;		[Test]&lt;br&gt;		public void TestDifferentLengthStrings()&lt;br&gt;		{&lt;br&gt;			string a1 = "fi";&lt;br&gt;			string a2 = "fish";&lt;br&gt;&lt;br&gt;			Assert.IsFalse(a1.IsEqualTo(a2));&lt;br&gt;		}&lt;br&gt;&lt;br&gt;		[Test]&lt;br&gt;		public void TestDifferentLengthStringsReverse()&lt;br&gt;		{&lt;br&gt;			string a1 = "fish";&lt;br&gt;			string a2 = "fi";&lt;br&gt;&lt;br&gt;			Assert.IsFalse(a1.IsEqualTo(a2));&lt;br&gt;		}</description>
		<content:encoded><![CDATA[<p>Jurgen, I&#8217;ve tested the function with different length strings &#038; it returns false as expected.  The reason is that it keeps looping until either enumerators has no more items, then it checks if both have  no more items.  If they both have no more, they&#8217;re the same length, so return true.  If the other enumerator has more items then they&#8217;re different lengths, so it returns false.</p>
<p>Both the following tests pass:</p>
<p>		[Test]<br />		public void TestDifferentLengthStrings()<br />		{<br />			string a1 = &#8220;fi&#8221;;<br />			string a2 = &#8220;fish&#8221;;</p>
<p>			Assert.IsFalse(a1.IsEqualTo(a2));<br />		}</p>
<p>		[Test]<br />		public void TestDifferentLengthStringsReverse()<br />		{<br />			string a1 = &#8220;fish&#8221;;<br />			string a2 = &#8220;fi&#8221;;</p>
<p>			Assert.IsFalse(a1.IsEqualTo(a2));<br />		}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Glenn Slaven</title>
		<link>http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-117108</link>
		<dc:creator>Glenn Slaven</dc:creator>
		<pubDate>Wed, 19 Mar 2008 12:05:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.slaven.net.au/archives/2008/03/16/comparing-two-arrays-or-ienumerables-in-c/#comment-117108</guid>
		<description>Ah, now I see it.  They Joys of working with enumerators.  I like the non-shortcuting solution, but I tend to agree with your opinion on readability over nominal performance improvement.  Besides, I speed tested both ways on a massive collection &#38; I couldn't detect any material difference.

Thanks for your help with this, and for your patience in getting your point through!  I added in some exception handling to dispose of resources in this revision too.</description>
		<content:encoded><![CDATA[<p>Ah, now I see it.  They Joys of working with enumerators.  I like the non-shortcuting solution, but I tend to agree with your opinion on readability over nominal performance improvement.  Besides, I speed tested both ways on a massive collection &amp; I couldn&#8217;t detect any material difference.</p>
<p>Thanks for your help with this, and for your patience in getting your point through!  I added in some exception handling to dispose of resources in this revision too.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
