[Issue 8946] « any » function does not what it should do

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 3 14:18:26 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8946



--- Comment #3 from Dmitry Olshansky <dmitry.olsh at gmail.com> 2012-11-03 14:18:25 PDT ---
> Ok, my argument wasn’t worth it I agree. But, why any would use such a function
where a simple loop and a test will do it?

Because find is a simple loop? To not duplicate code? If you have liner search
then it's obvious (for me) to reuse it for exactly the same task. any basically
gives you a bit less then find/countUntill (bool vs pointer-index) by doing the
same amount of work.

> it consumes more memory that we want. any does things we don’t want to IMHO.

Simply not true. I'm not sure where this 'memory' argument comes from at all.
In fact it saves some code space by not duplicating the same code over again.
At best this could be an enhancement request (or better yet - a pull request)
if there is a soild proof that the resulting code is measurably _faster_.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list