Page MenuHomePhabricator

rust-nodemap: abstracting the indexing
ClosedPublic

Authored by gracinet on Jan 6 2020, 2:25 PM.

Details

Summary

In the forthcoming mutable implementation, we'll have to visit
node trees that are more complex than a single slice, although
the algorithm will still be expressed in simple indexing terms.

We still refrain using #[inline] indications as being
premature optimizations, but we strongly hope the compiler will
indeed inline most of the glue.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

gracinet created this revision.Jan 6 2020, 2:25 PM
gracinet updated this revision to Diff 19135.Jan 10 2020, 10:03 AM
gracinet updated this revision to Diff 19325.Jan 15 2020, 6:47 PM
kevincox accepted this revision.Jan 16 2020, 5:10 AM
kevincox added inline comments.
rust/hg-core/src/revlog/nodemap.rs
240

I don't think this variable helps readability. I would just repeat self.len().

241

I would add a self.is_empty() helper. It's good practice for anything that has a .len().

gracinet updated this revision to Diff 19632.Jan 27 2020, 10:49 AM
gracinet marked 2 inline comments as done.Jan 27 2020, 10:53 AM
gracinet added inline comments.
rust/hg-core/src/revlog/nodemap.rs
241

Sure

gracinet marked an inline comment as done.Jan 27 2020, 2:13 PM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.