Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3961

Show
Ignore:
Timestamp:
10/04/08 02:13:58 (2 months ago)
Author:
kris
Message:

minor allocation cleanup. TODO: need something smarter than doubling the array size

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/util/container/more/Heap.d

    r3960 r3961  
    3636        { 
    3737                while (heap.length <= next) 
    38                 { 
    39                         heap.length = 2 * heap.length + 32; 
    40                 } 
     38                       heap.length = 2 * heap.length + 32; 
     39 
    4140                heap[next] = t; 
    4241                fixup (next); 
     
    4746        void push (T[] array) 
    4847        { 
    49                 while (heap.length < next + array.length) 
    50                 { 
    51                         heap.length = 2 * heap.length + 32; 
    52                 } 
     48                if (heap.length < next + array.length) 
     49                    heap.length = next + array.length + 32; 
     50                 
    5351                foreach (t; array) push (t); 
    5452        }