I understand your objections to minimize. I don't really have a preference, but I don't really like shrinkToFit. I'll use that for now, since it's probably easy to search/replace later.
-Steve ----- Original Message ---- > From: Andrei Alexandrescu <[email protected]> > > What about a "minimize" function, which simply truncates any > > "allocated" length after an array. So you would reset an array via: > > > > arr.length = 0; arr.minimize(); > > > > The advantage here is the array's length is not affected, just the > > allocated length is reduced to match the array's length. There are > > less invalid cases to worry about (i.e. "shrinking" to something > > larger doesn't make any sense). > > Sounds good. I'd choose a more specific name, e.g. shrinkToFit. Minimize has > me > think of optimization functions. > > Andrei > _______________________________________________ > phobos mailing list > [email protected] > http://lists.puremagic.com/mailman/listinfo/phobos _______________________________________________ phobos mailing list [email protected] http://lists.puremagic.com/mailman/listinfo/phobos
