#BUGFIX by cg
class: Dictionary
added:
#keyAtIdenticalValue:
#keyAtIdenticalValue:ifAbsent:
--- a/Dictionary.st Sun May 20 15:56:16 2018 +0200
+++ b/Dictionary.st Mon May 21 09:27:59 2018 +0200
@@ -767,6 +767,30 @@
"/ NOT REACHED
!
+keyAtIdenticalValue:aValue
+ "for protocol compatibility only:
+ return the key whose value is identical (i.e. using #== for compare)
+ to the argument, nil if none found.
+ This is a slow access, since there is no fast reverse mapping.
+ NOTICE:
+ The value is searched using identity compare;
+ use #keyAtEqualValue: to compare for equality."
+
+ ^ self keyAtIdentityValue:aValue
+!
+
+keyAtIdenticalValue:aValue ifAbsent:exceptionBlock
+ "for protocol compatibility only:
+ return the key whose value is identical (i.e. using #== for compare)
+ to the argument, nil if none found.
+ This is a slow access, since there is no fast reverse mapping.
+ NOTICE:
+ The value is searched using identity compare;
+ use #keyAtEqualValue: to compare for equality."
+
+ ^ self keyAtIdentityValue:aValue ifAbsent:exceptionBlock
+!
+
keyAtIdentityValue:aValue
"return the key whose value is identical (i.e. using #== for compare)
to the argument, nil if none found.