rust: rustlazyancestors.__contains__
This changeset provides a Rust implementation of the iteration performed by lazyancestor.__contains__ It has the advantage over the Python iteration to use the 'seen' set encapsuled into the dedicated iterator (self._containsiter), rather than storing emitted items in another set (self._containsseen), and hence should reduce the memory footprint. Also, there's no need to convert intermediate emitted revisions back into Python integers. At this point, it would be tempting to implement the whole lazyancestor object in Rust, but that would lead to more C wrapping code (two objects) for little expected benefits.
Showing
- mercurial/ancestor.py 16 additions, 2 deletionsmercurial/ancestor.py
- mercurial/cext/revlog.c 20 additions, 1 deletionmercurial/cext/revlog.c
- rust/hg-core/src/ancestors.rs 32 additions, 0 deletionsrust/hg-core/src/ancestors.rs
- rust/hg-direct-ffi/src/ancestors.rs 35 additions, 0 deletionsrust/hg-direct-ffi/src/ancestors.rs
- rust/hg-direct-ffi/src/lib.rs 4 additions, 1 deletionrust/hg-direct-ffi/src/lib.rs
Loading
Please register or sign in to comment