Robert Jacques wrote:
On Mon, 08 Mar 2010 16:42:54 -0500, Philippe Sigaud <[email protected]> wrote:

On Mon, Mar 8, 2010 at 14:22, Steven Schveighoffer <[email protected]>wrote:

The shrinkToFit name is not my favorite, anyone care to submit a better
name?  minimize is out because it has connotations of math already.


minCapacity
minimizeCapacity
shrinkCapacity
shrink (just shrink)
releaseCapacity
compacify
fitCapacity
minFit???
reduceToFit
contract
minify
adjust



Philippe

compact

Many of these names (including shrinkToFit) suggest that memory usage is reduced by freeing the left over memory after the array. This is not true: the function just enables stomping of the memory past the slice passed to the function.

It's a very specialized and dangerous function (but still may be critical for good performance), and maybe it should rather have a more convoluted/long name than a simple one.

Reply via email to