[Issue 13410] Performance problem with associative array byKey/byValue
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Sep 26 08:27:43 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13410
Steven Schveighoffer <schveiguy at yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |schveiguy at yahoo.com
--- Comment #17 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to Ketmar Dark from comment #12)
> (In reply to safety0ff.bugz from comment #10)
> > Furthermore, I don't think the plus one indexing is necessary.
> it's a matter of taste, i think. i need "cache turned off" flag, and zero is
> fine. sure we can use "size_t.max", for example, but then we can't use this
> trick:
>
> if (i+1 < aa.impl.firstUsedBucket) aa.impl.firstUsedBucket = i+1;
>
> and have to write
>
> if (aa.impl.firstUsedBucket != size_t.max && i < aa.impl.firstUsedBucket)
> aa.impl.firstUsedBucket = i;
>
> don't like it. ;-)
Hm... I think you can just use 0. When caching is off, you need to start
looking at bucket 0 anyway.
--
More information about the Digitalmars-d-bugs
mailing list