SortedCollection.st
changeset 14309 602e61cb64a3
parent 14308 b178c80c4884
child 14310 b1787ec39fd8
--- a/SortedCollection.st	Fri Aug 10 20:44:54 2012 +0200
+++ b/SortedCollection.st	Fri Aug 10 20:51:43 2012 +0200
@@ -327,49 +327,6 @@
     ^ self withAll:aCollection sortBlock:aBlock
 ! !
 
-!SortedCollection class methodsFor:'helpers'!
-
-binarySearch:aSortedArray from:firstIndex to:lastIndex forIndexOf:anObject usingSortBlock:sortBlock
-    "search the index at which to insert anObject.
-     Can also be used to search for an existing element
-     by checking if the element at the returned index is the one we look for.
-     Uses a binarySearch since we can depend on the elements being on sorted order.
-     The returned index is a physical one, for accessing contentsArray.
-     This is only to be used for arrays which are known to be sorted."
-
-    |low    "{ Class: SmallInteger}"
-     high   "{ Class: SmallInteger}"
-     middle "{ Class: SmallInteger}"
-     element|
-
-    "
-     we can of course use a binary search - since the elements are sorted
-    "
-    low := firstIndex.
-    high := lastIndex.
-    [low > high] whileFalse:[
-	middle := (low + high) // 2.
-	element := aSortedArray at:middle.
-	(sortBlock value:element value:anObject) ifTrue:[
-	    "middleelement is smaller than object"
-	    low := middle + 1
-	] ifFalse:[
-	    high := middle - 1
-	]
-    ].
-    ^ low
-
-    "
-     SortedCollection
-	binarySearch:#(1 2 3 4 7 99 1313 981989 898989898)
-	from:1 to:9
-	forIndexOf:99
-	usingSortBlock:[:a :b | a < b ]
-    "
-
-    "Modified: 12.4.1996 / 13:22:03 / cg"
-! !
-
 !SortedCollection methodsFor:'accessing'!
 
 largest:n
@@ -1033,7 +990,11 @@
 !SortedCollection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/SortedCollection.st,v 1.74 2012-08-10 18:44:54 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SortedCollection.st,v 1.75 2012-08-10 18:51:43 stefan Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libbasic/SortedCollection.st,v 1.75 2012-08-10 18:51:43 stefan Exp $'
 ! !
 
 SortedCollection initialize!