The following two methods return the error #rtErrNilKey (error 2090) when the specified key is nil. Since these methods are intended to provide alternate handling of nil keys, this is incorrect behavior.
#at:ifAbsent:
#at:otherwise:
As SystemUser file-in and commit the following code.
category: 'Accessing' method: RcKeyValueDictionary at: aKey ifAbsent: aBlock "Returns the value that corresponds to aKey. If no such key/value pair exists, returns the result of evaluating the zero-argument block aBlock." | hash | aKey == nil ifTrue: [ ^ aBlock value ]. hash := self hashFunction: aKey. ^ (self _at: hash) at: aKey ifAbsent: aBlock % category: 'Accessing' method: RcKeyValueDictionary at: aKey otherwise: aValue "Returns the value that corresponds to aKey. If no such key/value pair exists, returns the given alternate value." | hash | aKey == nil ifTrue: [ ^ value ]. hash := self hashFunction: aKey. ^ (self _at: hash) at: aKey otherwise: aValue %
Last updated: 1/23/15