Subject: | Error in documentation for rev_iter |
Date: | Tue, 2 Jul 2013 13:46:15 +0000 |
To: | "bug-tree-rb [...] rt.cpan.org" <bug-tree-rb [...] rt.cpan.org> |
From: | "Vromen, Tomer" <tomer.vromen [...] intel.com> |
Hi Arun,
There is a mistake in the documentation for the rev_iter([KEY]) method of Tree::RB (http://search.cpan.org/~arunbear/Tree-RB-0.500003/lib/Tree/RB.pm#rev_iter%28[KEY]%29):
rev_iter([KEY])
Returns an iterator object that can be used to traverse the tree in reverse order.
If a key is supplied, the iterator returned will traverse the tree in order starting from the node with key less than or equal to the specified key.
$it = $tree->rev_iter('France');
my $node = $it->next;
print $node->key; # -> 'England'
The supplied code example will print "France" (and not "England").
This is the correct behavior, as it allows to iterate through all the nodes. The mistake is only in the documentation.
Thanks,
Tomer Vromen
---------------------------------------------------------------------
Intel Israel (74) Limited
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.