Array.st
branchjv
changeset 20205 03e626304d06
parent 20150 3a825b090d4e
parent 20172 0855ffd234fa
child 20244 20922299fd44
equal deleted inserted replaced
20204:9a24c81d04ff 20205:03e626304d06
   631 addAllNonNilElementsTo:aCollection
   631 addAllNonNilElementsTo:aCollection
   632     "add all nonNil elements of the receiver to aCollection.
   632     "add all nonNil elements of the receiver to aCollection.
   633      Return aCollection.
   633      Return aCollection.
   634      Redefined here for slightly more speed."
   634      Redefined here for slightly more speed."
   635 
   635 
   636     |stop "{ Class: SmallInteger }"|
   636     |each stop "{ Class: SmallInteger }"|
   637 
   637 
   638     stop := self size.
   638     stop := self size.
   639     1 to:stop do:[:idx |
   639     1 to:stop do:[:idx |
   640 	|each|
   640         each := self at:idx.
   641 	each := self at:idx.
   641         each notNil ifTrue:[
   642 	each notNil ifTrue:[
   642             aCollection add:each.
   643 	    aCollection add:each.
   643         ].
   644 	].
       
   645     ].
   644     ].
   646     ^ aCollection
   645     ^ aCollection
   647 
   646 
   648     "
   647     "
   649      #(1 2 3 4 5 1 2 3 symbol 'string' nil) addAllNonNilElementsTo:Set new
   648      #(1 2 3 4 5 1 2 3 symbol 'string' nil) addAllNonNilElementsTo:Set new