Request for "indexOf" undeprecation.

Denis Shelomovskij verylonglogin.reg at gmail.com
Fri Nov 16 09:30:56 PST 2012


16.11.2012 17:18, monarch_dodra пишет:
> As you can see, when operating on UTF strings, the (expected) result of
> countUntil is not the same as that of indexOf.
>
> countUntil is currently bugged, in the sense that it will return the
> index in the string (as opposed to the count of popFront's).

Thanks, I forget to officially fill this bug some time ago. Pleased you 
are also finding Phobos bugs.

And I want to mention that `countUntil` is intentionally spoiled. See 
the sources:
---
// Narrow strings are handled a bit differently
---
and Andrei will probably argue that current dangerous like hell 
behaviour is correct and such cool feature must be undocumented and 
developers will be pleased to discover it because of data corruption. :)

But lets not blame Andrei because it was one of his insane big commits:
https://github.com/D-Programming-Language/phobos/commit/3ea2debb8c4a6a707447c684e94f651924efaa96
and he probably was superheated and didn't understand what is going on.


-- 
Денис В. Шеломовский
Denis V. Shelomovskij


More information about the Digitalmars-d mailing list