Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.810.mcz ==================== Summary ==================== Name: Collections-ul.810 Author: ul Time: 30 October 2018, 1:26:22.149414 am UUID: 33532c8f-187e-4914-9573-9a6a5390a97c Ancestors: Collections-topa.809 - renamed the methods #stringHashWithInitialHash: and #bytesHashWithInitialHash: to #hashWithInitialHash: =============== Diff against Collections-topa.809 =============== Item was removed: - ----- Method: ByteArray>>bytesHashWithInitialHash: (in category 'private') ----- - bytesHashWithInitialHash: speciesHash - "Answer the hash of a byte-indexed array, using speciesHash as the initial value. - See SmallInteger>>hashMultiply." - <primitive: 'primitiveStringHash' module: 'MiscPrimitivePlugin'> - - ^String stringHash: self initialHash: speciesHash! Item was changed: ----- Method: ByteArray>>hash (in category 'comparing') ----- hash "#hash is implemented, because #= is implemented" + ^self hashWithInitialHash: self species hash! - ^self bytesHashWithInitialHash: self species hash! Item was added: + ----- Method: ByteArray>>hashWithInitialHash: (in category 'private') ----- + hashWithInitialHash: speciesHash + "Answer the hash of a byte-indexed array, using speciesHash as the initial value. + See SmallInteger>>hashMultiply." + <primitive: 'primitiveStringHash' module: 'MiscPrimitivePlugin'> + + ^String stringHash: self initialHash: speciesHash! Item was added: + ----- Method: ByteString>>hashWithInitialHash: (in category 'private') ----- + hashWithInitialHash: speciesHash + "Answer the hash of a byte-indexed string, using speciesHash as the initial value. + See SmallInteger>>hashMultiply." + <primitive: 'primitiveStringHash' module: 'MiscPrimitivePlugin'> + + ^super hashWithInitialHash: speciesHash! Item was removed: - ----- Method: ByteString>>stringHashWithInitialHash: (in category 'private') ----- - stringHashWithInitialHash: speciesHash - "Answer the hash of a byte-indexed string, using speciesHash as the initial value. - See SmallInteger>>hashMultiply." - <primitive: 'primitiveStringHash' module: 'MiscPrimitivePlugin'> - - ^super stringHashWithInitialHash: speciesHash! Item was added: + ----- Method: ByteSymbol>>hashWithInitialHash: (in category 'private') ----- + hashWithInitialHash: speciesHash + "Answer the hash of a byte-indexed string, using speciesHash as the initial value. + See SmallInteger>>hashMultiply." + <primitive: 'primitiveStringHash' module: 'MiscPrimitivePlugin'> + + ^super hashWithInitialHash: speciesHash! Item was removed: - ----- Method: ByteSymbol>>stringHashWithInitialHash: (in category 'private') ----- - stringHashWithInitialHash: speciesHash - "Answer the hash of a byte-indexed string, using speciesHash as the initial value. - See SmallInteger>>hashMultiply." - <primitive: 'primitiveStringHash' module: 'MiscPrimitivePlugin'> - - ^super stringHashWithInitialHash: speciesHash! Item was changed: ----- Method: String>>hash (in category 'comparing') ----- hash "#hash is implemented, because #= is implemented" "ar 4/10/2005: I had to change this to use ByteString hash as initial hash in order to avoid having to rehash everything and yet compute the same hash for ByteString and WideString. md 16/10/2006: use identityHash as initialHash, as behavior hash will use String hash (name) to have a better hash soon. eem 4/17/2017 it's not possible to use String hash (name) for the initial hash because that would be recursive." + ^self hashWithInitialHash: ByteString identityHash! - ^self stringHashWithInitialHash: ByteString identityHash! Item was changed: + ----- Method: String>>hashWithInitialHash: (in category 'private') ----- + hashWithInitialHash: speciesHash + "Answer the hash of a byte-indexed string, using speciesHash as the initial value. + See SmallInteger>>hashMultiply." + | hash | + hash := speciesHash bitAnd: 16r0FFFFFFF. + 1 to: self size do: + [:pos | + hash := (hash + (self basicAt: pos)) hashMultiply]. + ^hash! - ----- Method: String>>hashWithInitialHash: (in category 'comparing') ----- - hashWithInitialHash: initialHash - - ^ self class stringHash: self initialHash: initialHash! Item was removed: - ----- Method: String>>stringHashWithInitialHash: (in category 'private') ----- - stringHashWithInitialHash: speciesHash - "Answer the hash of a byte-indexed string, using speciesHash as the initial value. - See SmallInteger>>hashMultiply." - | hash | - hash := speciesHash bitAnd: 16r0FFFFFFF. - 1 to: self size do: - [:pos | - hash := (hash + (self basicAt: pos)) hashMultiply]. - ^hash! |
Free forum by Nabble | Edit this page |