D-Programming-Language/phobos — pull request #1003 by monarchdodra (2012-12-11 11:13:04+00:00)
Title: split white improvments (try 3)

This is a "toned down" version of: https://github.com/D-Programming-Language/phobos/pull/983

That was too involved for what I can currently give to D.

I've toned down the intent of the pull. Now, it contains:
1. The simple but efficient improvement to `std.uni.isWhite`
2. Fixed split to correctly split on unicode whites
3. Changed the algorithm for more performance
4. Made split safe/pure (and nothrow for dstrings).

Note: In the end, I did not use Appender. This was in conflict with split's safety/purity. Left a "todo" I guess, but I don't know when we'll get to it.

Note: My algorithm is better than the previous one if only because it is pure. When using `foreach(dchar)`, the foreach forwards to a delegate. This creates a conflict with a pure delegate modifying values outside of the scope its scope (the foreach modifying the `inword` and whatnot):
https://github.com/monarchdodra/phobos/commit/fecc396cac0987e640a0c30d953019658db90028

Note: I will come back to work on decodeIsWhite, but it is currently too much work for me. I've stashed it asside, and *will* come back to it, just not now. I'd rather this be fixed now. Besides, I don't think the performance of split is *critical* or anything.

Apologies to the reviewers, but the work is not lost.