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
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.