equal
deleted
inserted
replaced
18 ! |
18 ! |
19 |
19 |
20 WeakIdentityDictionary comment:' |
20 WeakIdentityDictionary comment:' |
21 COPYRIGHT (c) 1992 by Claus Gittinger |
21 COPYRIGHT (c) 1992 by Claus Gittinger |
22 All Rights Reserved |
22 All Rights Reserved |
|
23 |
|
24 $Header: /cvs/stx/stx/libbasic/WeakIdentityDictionary.st,v 1.5 1994-08-05 01:03:06 claus Exp $ |
23 '! |
25 '! |
24 |
26 |
25 !WeakIdentityDictionary class methodsFor:'documentation'! |
27 !WeakIdentityDictionary class methodsFor:'documentation'! |
26 |
28 |
27 copyright |
29 copyright |
38 " |
40 " |
39 ! |
41 ! |
40 |
42 |
41 version |
43 version |
42 " |
44 " |
43 $Header: /cvs/stx/stx/libbasic/WeakIdentityDictionary.st,v 1.4 1994-06-02 16:22:47 claus Exp $ |
45 $Header: /cvs/stx/stx/libbasic/WeakIdentityDictionary.st,v 1.5 1994-08-05 01:03:06 claus Exp $ |
44 " |
46 " |
45 ! |
47 ! |
46 |
48 |
47 documentation |
49 documentation |
48 " |
50 " |
79 sz := keyArray size. |
81 sz := keyArray size. |
80 any := false. |
82 any := false. |
81 1 to:sz do:[:index | |
83 1 to:sz do:[:index | |
82 (keyArray at:index) isNil ifTrue:[ |
84 (keyArray at:index) isNil ifTrue:[ |
83 (valueArray at:index) notNil ifTrue:[ |
85 (valueArray at:index) notNil ifTrue:[ |
|
86 " |
|
87 if the next slot is not nil, it could be there due |
|
88 to a hash collision. In this case we have to put a |
|
89 DeletedMark into the slot. |
|
90 " |
|
91 "/ soon to come; can then avoid rehash |
|
92 "/ |
|
93 "/ index == sz ifTrue:[ |
|
94 "/ next := 1 |
|
95 "/ ] ifFalse:[ |
|
96 "/ next := index + 1. |
|
97 "/ ]. |
|
98 "/ |
|
99 "/ (keyArray basicAt:next) notNil ifTrue:[ |
|
100 "/ (valueArray basicAt:next) notNil ifTrue:[ |
|
101 "/ keyArray basicAt:index put:DeletedEntry |
|
102 "/ ] |
|
103 "/ ]. |
|
104 |
84 valueArray at:index put:nil. |
105 valueArray at:index put:nil. |
85 tally := tally - 1. |
106 tally := tally - 1. |
86 any := true |
107 any := true |
87 ] |
108 ] |
88 ] |
109 ] |