equal
deleted
inserted
replaced
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 |