#BUGFIX by exept
authorClaus Gittinger <cg@exept.de>
Tue, 27 Aug 2019 11:05:55 +0200
changeset 24667 fdbe0a558746
parent 24666 9174ec9cf9f6
child 24668 428fc2bc187b
#BUGFIX by exept class: SequenceableCollection comment/format in: #map:at:ifAbsent: changed: #asMapAt:ifAbsent: #asMapKeyAtValue:ifAbsent:
SequenceableCollection.st
--- 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
 
     "
      #(