Page MenuHomePhabricator

Refactor IsCompressedOrUncompressedPubKey
ClosedPublic

Authored by deadalnix on Jul 15 2018, 18:29.

Details

Summary

Using a switch is much more readable than a bunch of nested ifs.

Depends on D1568

Test Plan
make check

Diff Detail

Repository
rABC Bitcoin ABC
Branch
checkpubkeyencodingrefactor
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 2880
Build 3864: Bitcoin ABC Buildbot (legacy)
Build 3863: arc lint + arc unit

Event Timeline

kyuupichan added a subscriber: kyuupichan.
kyuupichan added inline comments.
src/script/sigencoding.cpp
154 ↗(On Diff #4312)

Even better to collapse the first if in the switch by switching on size instead of the first byte, no?

That gives just 2 entries in the switch other than default, too.

This revision now requires changes to proceed.Jul 16 2018, 00:09

Update to switch on size rather than on first byte which simplify the logic.

This revision is now accepted and ready to land.Jul 16 2018, 11:35
This revision was automatically updated to reflect the committed changes.