Page MenuHomePhabricator

cleanup: use mergestate.unresolvedcount() instead of bool(list(unresolved()))
AcceptedPublic

Authored by durin42 on May 18 2020, 6:08 PM.

Details

Reviewers
marmoute
pulkit
Group Reviewers
hg-reviewers
Summary

This avoids some pointless copying.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

durin42 created this revision.May 18 2020, 6:08 PM
durin42 updated this revision to Diff 21511.May 28 2020, 4:26 PM

how well, I see why you want an explicite method to avoid unrolling the iterator. Could we return an object with sensible bool and len methods?

how well, I see why you want an explicite method to avoid unrolling the iterator. Could we return an object with sensible bool and len methods?

I'd rather not: right now we have no extra type overhead, and if we make unresolved() return some custom iterator type it'll add extra bookkeeping etc.

If you feel strongly, I'd much rather someone that cares do that as a follow-up, since I'm just trying to do a quick-win case here.

durin42 updated this revision to Diff 21594.Jun 9 2020, 4:51 PM
marmoute accepted this revision.Jun 10 2020, 5:35 AM

how well, I see why you want an explicite method to avoid unrolling the iterator. Could we return an object with sensible bool and len methods?

I'd rather not: right now we have no extra type overhead, and if we make unresolved() return some custom iterator type it'll add extra bookkeeping etc.
If you feel strongly, I'd much rather someone that cares do that as a follow-up, since I'm just trying to do a quick-win case here.

nevermind, I got confused, the unresolvedcount method existed before your series, so this patch is clear win.

pulkit accepted this revision.Jun 17 2020, 9:25 AM
This revision is now accepted and ready to land.Jun 17 2020, 9:25 AM