On Fri, Sep 11, 2015 at 9:24 AM, Nick Craig-Wood <
ni...@craig-wood.com> wrote:
> On 11/09/15 13:38, James Bardin wrote:
>> On Friday, September 11, 2015 at 8:27:42 AM UTC-4, Shafreeck Sea wrote:
>> Why not using a more simple way:
>> db.connRequests = db.connRequests[1:]
>>
>> This leaves the first element of the underlying slice inaccessible. If
>> this is continually done, along with more appends, the slice array would
>> continue to grow.
>
> That isn't actually true.
>
> If there are appends, then sooner or later one of them will trigger a
> re-allocation, the slice data will be copied and the empty space at the
> front will be reclaimed.
>
Yes, sorry, mis-spoke here. It wouldn't grow, it could just wast the