#BUGFIX by exept
class: SequenceableCollection
comment/format in: #map:at:ifAbsent:
changed:
#asMapAt:ifAbsent:
#asMapKeyAtValue:ifAbsent:
--- a/SequenceableCollection.st Tue Aug 27 10:55:02 2019 +0200
+++ b/SequenceableCollection.st Tue Aug 27 11:05:55 2019 +0200
@@ -7910,11 +7910,10 @@
So this is useful for seldom encountered map operations, for which a more
efficient Dictionary is not wanted."
- |idx|
-
- idx := self indexOf:key.
- idx == 0 ifTrue:[^ exceptionValue value].
- ^ self at:(idx + 1)
+ self pairWiseDo:[:eachKey :eachValue |
+ key = eachKey ifTrue:[^ eachValue].
+ ].
+ ^ exceptionValue value
"
#(
@@ -7946,11 +7945,10 @@
So this is useful for seldom encountered map operations, for which a more
efficient Dictionary is not wanted."
- |idx|
-
- idx := self indexOf:value.
- idx == 0 ifTrue:[^ exceptionValue value].
- ^ self at:(idx - 1)
+ self pairWiseDo:[:eachKey :eachValue |
+ value = eachValue ifTrue:[^ eachKey].
+ ].
+ ^ exceptionValue value
"
#(