Thread overview
[Issue 10933] findSplitBefore/After should have needle-less overloads
Mar 21, 2018
Luís Marques
Mar 21, 2018
Luís Marques
Dec 17, 2022
Iain Buclaw
March 21, 2018
https://issues.dlang.org/show_bug.cgi?id=10933

Luís Marques <luis@luismarques.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |luis@luismarques.eu

--
March 21, 2018
https://issues.dlang.org/show_bug.cgi?id=10933

--- Comment #1 from Luís Marques <luis@luismarques.eu> ---
Yup, I've ran into the same issue multiple times. This last time with the plain findSplit; I don't recall if also with findSplitBefore/After.

This workaround works:

range.byCodeUnit.findSplit!((a, b) => a.isWhite)(" ");

Interestingly, if you use "" instead of " " it won't work, which arguably is a bug, since the predicate doesn't even use b.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=10933

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P4

--