This is an archive of the discontinued Mercurial Phabricator instance.

hg-core: make parse_dirstate return references rather than update hashmaps

Authored by acezar on Aug 3 2020, 10:25 AM.



Returing a vec is faster than updating a hashmap when the hashmap is not needed
like in hg files which just list tracked files.

Returning references avoid copying data when not needed improving performence
for large repositories.

Diff Detail

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

Event Timeline

acezar created this revision.Aug 3 2020, 10:25 AM
Alphare accepted this revision.Aug 3 2020, 10:59 AM
Alphare added a subscriber: Alphare.
Alphare added inline comments.

These should be a collect() instead of default + extend.

acezar updated this revision to Diff 22245.Aug 4 2020, 4:57 AM
acezar updated this revision to Diff 22267.Aug 5 2020, 4:58 AM
indygreg accepted this revision.Aug 8 2020, 3:43 PM
This revision is now accepted and ready to land.Aug 8 2020, 3:43 PM