Page MenuHomePhabricator

pure: guard against empty blocks
ClosedPublic

Authored by indygreg on Nov 7 2020, 8:22 PM.

Details

Summary

If blocks is empty, we append None to the returned list, which is
incorrect.

This subtle issue was caught by pytype, which correctly identified
the return value as List[Optional[Tuple]] because of this possibility.

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

indygreg created this revision.Nov 7 2020, 8:22 PM
Alphare accepted this revision.Nov 13 2020, 5:00 AM
This revision was not accepted when it landed; it landed in state Needs Review.
This revision was automatically updated to reflect the committed changes.