<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>I'm guessing</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">| ed id |</div><div id="AppleMailSignature">ed := Dictionary with: 'a' -&gt; $a.</div><div id="AppleMailSignature">id<span style="background-color: rgba(255, 255, 255, 0);">&nbsp;:= IdentityDictionary with: 'a' copy -&gt; $a.</span></div><div id="AppleMailSignature">{ ed = id. id = ed }<br><br><span style="background-color: rgba(255, 255, 255, 0);">_,,,^..^,,,_ (phone)</span></div><div><br>On Oct 12, 2015, at 5:14 PM, Chris Muller &lt;<a href="mailto:asqueaker@gmail.com">asqueaker@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">This extra check halves the speed of Dictionary&gt;&gt;= when they are equal, for all cases which consider equivalence symmetrical.&nbsp; If a=b, then it should be able to be assumed that b=a.&nbsp; What case is it not?</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 12, 2015 at 7:02 PM,  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Levente Uzonyi uploaded a new version of Collections to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Collections-ul.668.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/trunk/Collections-ul.668.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Collections-ul.668<br>
Author: ul<br>
Time: 13 October 2015, 1:07:48.216 am<br>
UUID: 8abfa05a-70c6-4e38-bc00-7d665183106c<br>
Ancestors: Collections-ul.667<br>
<br>
In Dictionary &gt;&gt; #=, make sure that the dictionaries agree on what the common keys are. This way the behaviour of #= will be symmetric when the two dictionaries implement key equality differently.<br>
<br>
=============== Diff against Collections-ul.667 ===============<br>
<br>
Item was changed:<br>
&nbsp; ----- Method: Dictionary&gt;&gt;= (in category 'comparing') -----<br>
+ = anObject<br>
- = aDictionary<br>
&nbsp; &nbsp; &nbsp; &nbsp; "Two dictionaries are equal if<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(a) they are the same 'kind' of thing.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(b) they have the same set of keys.<br>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(c) for each (common) key, they have the same value"<br>
<br>
+&nbsp; &nbsp; &nbsp; &nbsp;self == anObject ifTrue: [ ^true ].<br>
+&nbsp; &nbsp; &nbsp; &nbsp;anObject isDictionary ifFalse: [ ^false ].<br>
+&nbsp; &nbsp; &nbsp; &nbsp;self size = anObject size ifFalse: [ ^false ].<br>
+&nbsp; &nbsp; &nbsp; &nbsp;self associationsDo: [ :association |<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(anObject at: association key ifAbsent: [ ^false ]) = association value<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ifFalse: [ ^false ] ].<br>
+&nbsp; &nbsp; &nbsp; &nbsp;"The two dictionaries may have different ideas about equal keys, so check both ways to avoid any inconsistency."<br>
+&nbsp; &nbsp; &nbsp; &nbsp;anObject associationsDo: [ :association |<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(self at: association key ifAbsent: [ ^false ]) = association value<br>
+&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ifFalse:&nbsp; [ ^false ] ].<br>
+&nbsp; &nbsp; &nbsp; &nbsp;^true!<br>
-&nbsp; &nbsp; &nbsp; &nbsp;self == aDictionary ifTrue: [ ^ true ].<br>
-&nbsp; &nbsp; &nbsp; &nbsp;aDictionary isDictionary ifFalse: [^false].<br>
-&nbsp; &nbsp; &nbsp; &nbsp;self size = aDictionary size ifFalse: [^false].<br>
-&nbsp; &nbsp; &nbsp; &nbsp;self associationsDo: [:assoc|<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(aDictionary at: assoc key ifAbsent: [^false]) = assoc value<br>
-&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ifFalse: [^false]].<br>
-&nbsp; &nbsp; &nbsp; &nbsp;^true<br>
-<br>
- !<br>
<br>
<br>
</blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span></span><br></div></blockquote></body></html>