Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[CVS ci] hash iter: buggy initial try

9 views
Skip to first unread message

Leopold Toetsch

unread,
Jul 5, 2003, 8:16:21 AM7/5/03
to P6I
This is a first attempt to iterate over hashes.
The hash is scanned linearly, until the given integer index is found.

Is there a better way to locate the next entry, either by an integer idx
or by a key or some other means?

leo

Sean O'Rourke

unread,
Jul 5, 2003, 9:34:16 AM7/5/03
to Leopold Toetsch, P6I

It's constant time if you keep a bucket index and a pointer to the
current hash bucket in the iterator (see e.g. hash.c:hash_clone()).

/s

Leopold Toetsch

unread,
Jul 5, 2003, 12:53:35 PM7/5/03
to Sean O'Rourke, perl6-i...@perl.org

Thanks for the hint. That's it (albeit no pointer because of GC).

Done.

> /s

leo

0 new messages