Object.st
changeset 8372 ef63fde56d72
parent 8371 4493f5ac7405
child 8377 8fe731cf98d1
--- a/Object.st	Fri Jun 04 15:22:43 2004 +0200
+++ b/Object.st	Fri Jun 04 19:54:14 2004 +0200
@@ -2597,7 +2597,6 @@
         aCopy := myClass basicNew
     ].
     aCopy setHashFrom:self.
-
     aDictionary at:self put:aCopy.
 
     "
@@ -2612,9 +2611,10 @@
             1 to:sz do:[:i | 
                 iOrig := self basicAt:i.
                 iOrig notNil ifTrue:[
-                    (aDictionary includesKey:iOrig) ifTrue:[
-                        iCopy := aDictionary at:iOrig
-                    ] ifFalse:[
+                    "/ used to be dict-includesKey-ifTrue[dict-at:], 
+                    "/ changed to use dict-at:ifAbsent:, to avoid double lookup in dictionary
+                    iCopy := aDictionary at:iOrig ifAbsent:nil.
+                    iCopy isNil ifTrue:[
                         iCopy := (iOrig deepCopyUsing:aDictionary) postDeepCopy
                     ].
                     aCopy basicAt:i put:iCopy
@@ -2631,9 +2631,8 @@
         (self skipInstvarIndexInDeepCopy:i) ifFalse:[
             iOrig := self instVarAt:i.
             iOrig notNil ifTrue:[
-                (aDictionary includesKey:iOrig) ifTrue:[
-                    iCopy := aDictionary at:iOrig
-                ] ifFalse:[
+                iCopy := aDictionary at:iOrig ifAbsent:nil.
+                iCopy isNil ifTrue:[
                     iCopy := (iOrig deepCopyUsing:aDictionary) postDeepCopy
                 ].
                 aCopy instVarAt:i put:iCopy
@@ -9151,7 +9150,7 @@
 !Object class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.496 2004-06-04 13:22:43 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Object.st,v 1.497 2004-06-04 17:54:14 ca Exp $'
 ! !
 
 Object initialize!