commonLength

"Nordlöw" via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 15 05:01:48 PST 2015


I want a variant of commonPrefix(a, b) at

     http://dlang.org/phobos/std_algorithm.html#commonPrefix

that only counts returns the length of commonPrefix(a, b)

Is commonPrefix lazy enough to make

     commonPrefix(a, b).count

as fast as

     zip(a, b).count!(ab => ab[0] == ab[1])

?


More information about the Digitalmars-d-learn mailing list