--- a/List.st Tue Apr 07 09:54:19 1998 +0200
+++ b/List.st Tue Apr 07 13:39:08 1998 +0200
@@ -173,6 +173,25 @@
"Created: / 26.1.1998 / 11:10:55 / cg"
!
+clearContents
+ "remove all elements from the collection but keep the contentsArray.
+ Useful for huge lists, if the contents will be rebuild soon (using #add:)
+ to a size which is similar to the lists current size.
+ Returns the receiver."
+
+ |prevSize|
+
+ prevSize := self size.
+ super clearContents.
+
+ prevSize ~~ 0 ifTrue:[
+ dependents notNil ifTrue:[
+ self changed:#removeFrom: with:(Array with:1 with:prevSize)
+ ]
+ ]
+
+!
+
removeAll
"remove all elements from the collection.
Returns the receiver."
@@ -322,5 +341,5 @@
!List class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic2/List.st,v 1.10 1998-02-02 18:07:57 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic2/List.st,v 1.11 1998-04-07 11:39:08 ca Exp $'
! !