|
Re: collection enumeration: msg#00219lang.smalltalk.squeak.beginners
cdrick a écrit : >> This can be fast if collection is an array and if you say "1 to: >> collection do: [:index | ..." >> instead of creating an interval. The compiler cheats for to:do: on a >> SmallInteger and doesn't create the block. But I would only use this >> if the profiler showed it was a real improvement. Almost always I >> would use option C. > > same here or the method Bert has given.. #withIndexDo: It's strange that we have #withIndexDo: and #keysAndValuesDo: doing the same things on SequenceableCollection. For me #keysAndValuesDo: take more sense in a dictionary. (?) Math
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: collection enumeration, Marcus Denker |
|---|---|
| Next by Date: | diffing running images between machines?, Bakki Kudva |
| Previous by Thread: | Re: collection enumeration, cdrick |
| Next by Thread: | diffing running images between machines?, Bakki Kudva |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |