This is an archive of the discontinued LLVM Phabricator instance.

[opt-viewer] Remove positional arg checks (NFC)
ClosedPublic

Authored by modocache on Jun 23 2017, 12:53 PM.

Details

Summary

opt-stats.py and opt-viewer.py's argument parsers both take a positional
argument 'yaml_files'. Positional arguments in Python's argparse module are
required by default, so the subsequent checks for len(args.yaml_files) == 0
are unnecessary -- if the length was zero, then the call to
parser.parse_args() would have thrown an error already.

Because there is no way for len(args.yaml_files) to be zero at these
points, removing the code is NFC.

Event Timeline

modocache created this revision.Jun 23 2017, 12:53 PM
anemet accepted this revision.Jun 23 2017, 12:55 PM

LGTM, thanks!

This revision is now accepted and ready to land.Jun 23 2017, 12:55 PM
modocache closed this revision.Jun 23 2017, 1:07 PM