ArrColl.st
changeset 990 284134c88e19
parent 916 a050d17c7e1f
child 1111 d8e423b7d5a1
equal deleted inserted replaced
989:b8bf7496110c 990:284134c88e19
   234 
   234 
   235     |newArray oldSize sender|
   235     |newArray oldSize sender|
   236 
   236 
   237     oldSize := self size.
   237     oldSize := self size.
   238     (newSize ~~ oldSize) ifTrue:[
   238     (newSize ~~ oldSize) ifTrue:[
   239 	"/
   239 	InfoPrinting ifTrue:[
   240 	"/ output a warning - you should rewrite your application
   240 	    "/
   241 	"/ to use some collection which implements grow: more efficient
   241 	    "/ output a warning - you should rewrite your application
   242 	"/ (i.e. use OrderedCollection instead of Array ..)
   242 	    "/ to use some collection which implements grow: more efficient
   243 	"/
   243 	    "/ (i.e. use OrderedCollection instead of Array ..)
   244 	'ARRCOLL: Warning: slow grow operation (' infoPrint.
   244 	    "/
   245 	self class name infoPrint. ') via ' infoPrint.
   245 	    'ARRCOLL: Warning: slow grow operation (' infoPrint.
   246         sender := thisContext sender.
   246 	    self class name infoPrint. ') via ' infoPrint.
   247 	sender methodPrintString infoPrint. 
   247             sender := thisContext sender.
   248 	' from ' infoPrint. sender sender methodPrintString infoPrintNL.
   248 	    sender methodPrintString infoPrint. 
       
   249 	    ' from ' infoPrint. sender sender methodPrintString infoPrintNL.
       
   250 	].
   249 
   251 
   250 	newArray := self species new:newSize.
   252 	newArray := self species new:newSize.
   251 	newArray replaceFrom:1 to:(newSize min:oldSize) with:self.
   253 	newArray replaceFrom:1 to:(newSize min:oldSize) with:self.
   252 	self become:newArray.
   254 	self become:newArray.
   253     ]
   255     ]
   298 ! !
   300 ! !
   299 
   301 
   300 !ArrayedCollection class methodsFor:'documentation'!
   302 !ArrayedCollection class methodsFor:'documentation'!
   301 
   303 
   302 version
   304 version
   303     ^ '$Header: /cvs/stx/stx/libbasic/Attic/ArrColl.st,v 1.29 1996-01-30 17:15:01 cg Exp $'
   305     ^ '$Header: /cvs/stx/stx/libbasic/Attic/ArrColl.st,v 1.30 1996-02-21 14:10:57 cg Exp $'
   304 ! !
   306 ! !