--- a/SequenceableCollection.st Fri Jun 28 17:42:51 1996 +0200
+++ b/SequenceableCollection.st Sat Jun 29 11:43:34 1996 +0200
@@ -2609,14 +2609,13 @@
hiIndex := self size.
lowIndex := 1.
[lowIndex < hiIndex] whileTrue:[
- t1 := self at:lowIndex.
- t2 := self at:hiIndex.
- self at:lowIndex put:t2.
- self at:hiIndex put:t1.
+ t1 := self at:lowIndex. t2 := self at:hiIndex.
+ self at:lowIndex put:t2. self at:hiIndex put:t1.
lowIndex := lowIndex + 1.
hiIndex := hiIndex - 1
]
+
"
#(4 5 6 7 7) reverse
#(1 4 7 10 2 5) asOrderedCollection reverse
@@ -2720,21 +2719,21 @@
|smallestIndex "{ Class: SmallInteger }"
end "{ Class: SmallInteger }"
+ index2 "{ Class: SmallInteger }"
smallest thisOne|
"this is just a q&d hack - there must be better implementations for this ;-)"
end := self size.
1 to:end-1 do:[:index |
- |index2|
-
smallest := self at:index.
smallestIndex := index.
index2 := index + 1.
[
thisOne := self at:index2.
- (index2 ~~ smallestIndex and:[(sortBlock value:thisOne value:smallest)]) ifTrue:[
+ (index2 ~~ smallestIndex
+ and:[sortBlock value:thisOne value:smallest]) ifTrue:[
smallestIndex := index2.
smallest := thisOne.
index2 := index + 1.
@@ -2750,6 +2749,7 @@
"/ smallest := thisOne
"/ ].
"/ ].
+
(smallestIndex ~~ index) ifTrue:[
thisOne := self at:index.
self at:index put:smallest.
@@ -2768,5 +2768,5 @@
!SequenceableCollection class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.65 1996-05-18 15:30:02 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.66 1996-06-29 09:43:34 cg Exp $'
! !