setLen without 0-initialization (for efficiency)

2018-09-24 Thread timothee
Is it currently possible to call seq setLen without 0-initialization (for 
efficiency)? newSeqOfCap is not applicable since I want to reuse a buffer if 
not, should we add an overload for setLen? 


Re: setLen without 0-initialization (for efficiency)

2018-09-25 Thread mratsim
If the new length doesn't grow past the current capacity it doesn't 0-init.

No way otherwise AFAIK.


Re: setLen without 0-initialization (for efficiency)

2018-09-25 Thread Araq
It is not possible.


Re: setLen without 0-initialization (for efficiency)

2018-09-26 Thread timothee
PR's accepted?


Re: setLen without 0-initialization (for efficiency)

2018-09-26 Thread cblake
+1 on the feature. I also sometimes re-use buffers that would benefit from this.