This is an archive of the discontinued Mercurial Phabricator instance.

mergeresult: yield from getactions() instead of buidling a list and returning
ClosedPublic

Authored by pulkit on Aug 5 2020, 4:53 AM.

Details

Summary

Only 7 out of 29 callers change the underlying dict while iterating. So it's
better to yield and wrap the 7 callers with list().

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

pulkit created this revision.Aug 5 2020, 4:53 AM
pulkit updated this revision to Diff 22303.Aug 6 2020, 7:14 AM
indygreg accepted this revision.Aug 8 2020, 12:25 PM
indygreg added a subscriber: indygreg.

Yeah, I suppose mutation during iteration will make a lot of noise. So as long as we have test coverage of this code, we should be fine.

This revision is now accepted and ready to land.Aug 8 2020, 12:25 PM