Can you shrink it further?

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 11 01:57:46 PDT 2016


On Tuesday, 11 October 2016 at 08:44:04 UTC, Temtaime wrote:
>
> void popFront1(ref char[] s) @trusted pure nothrow
> {
>   import core.bitop, std.algorithm;
>   auto v = bsr(~s[0] | 1);
>   s = s[clamp(v, 1, v > 6 ? 1 : $)..$];
> }
>
> Seems to be less if i'm not wrong.


Yours runs with 790 us best time.
bsr is a real timetaker :)



More information about the Digitalmars-d mailing list