This is an archive of the discontinued Mercurial Phabricator instance.

rust: Remove DirstateMap::file_fold_map
ClosedPublic

Authored by SimonSapin on Apr 20 2021, 10:18 AM.

Details

Summary

This was a HashMap constructed on demand and then cached in the DirstateMap
struct to avoid reconstructing at the next access. However the only use is
in Python bindings converting it to a PyDict. That method in turn is wrapped
in a @cachedproperty in Python code.

This was two redudant layers of caching. This changeset removes the Rust-level
one to keep the Python dict cache, and have bindings create a PyDict by
iterating.

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

SimonSapin created this revision.Apr 20 2021, 10:18 AM
baymax updated this revision to Diff 27143.Apr 20 2021, 1:03 PM

✅ refresh by Heptapod after a successful CI run (🐙 💚)

Alphare accepted this revision.Apr 22 2021, 5:26 AM
Alphare added a subscriber: Alphare.

A welcome change!

This revision is now accepted and ready to land.Apr 22 2021, 5:26 AM
SimonSapin updated this revision to Diff 27319.May 3 2021, 6:24 AM
This revision was automatically updated to reflect the committed changes.