findFirst: refactored
authorClaus Gittinger <cg@exept.de>
Mon, 18 May 2009 16:48:39 +0200
changeset 2147 b2f5a09a6174
parent 2146 241ff257121b
child 2148 5fe0c7beef0c
findFirst: refactored
RunArray.st
--- a/RunArray.st	Mon May 18 16:48:21 2009 +0200
+++ b/RunArray.st	Mon May 18 16:48:39 2009 +0200
@@ -1166,7 +1166,7 @@
 
 !RunArray methodsFor:'searching'!
 
-findFirst:aBlock
+findFirst:aBlock ifNone:exceptionalValue
     "find the index of the first element, for which evaluation of the argument, aBlock
      returns true; return its index or 0 if none detected.
      Notice, that not all elements are processed here 
@@ -1181,7 +1181,7 @@
             idx := idx + len.
         ]
     ].
-    ^ 0
+    ^ exceptionalValue value
 
     "
      (RunArray new 
@@ -1316,5 +1316,5 @@
 !RunArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/RunArray.st,v 1.27 2009-03-16 15:15:05 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/RunArray.st,v 1.28 2009-05-18 14:48:39 cg Exp $'
 ! !