Skip to content
Snippets Groups Projects
Commit 2aa94b6f authored by Pierre-Yves David's avatar Pierre-Yves David
Browse files

revset: make generatorset.__nonzero__ lazy

The 'for r in self:' call could trigger full consumption of the generator while
we only need a single value. We also fast path if a single value got already
computed. See inline comment for more details.

This provide massive speedup for lazy operation using boolean testing.

max(::tip)
e5b507efb36e) wall 0.055609 comb 0.060000 user 0.060000 sys 0.000000 (best of 100)
after change) wall 0.000109 comb 0.000000 user 0.000000 sys 0.000000 (best of 19146)
parent 3035b75c
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment