Simplify s_char_to_int and align DECODE_V macro #804
Labels
No labels
bug
duplicate
enhancement
feature
help wanted
improve API
invalid
needs documentation
not-planned
rtfm
stale
support
wishlist
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-libtom/libtomcrypt#804
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The current implementation uses a switch with ten cases:
This could be simplified to a range check and subtraction:
This is shorter, clearer, and should be equally efficient. If you simplify it like that, remember to do so in src/pk/asn1/der/utctime/der_decode_utctime.c but also in src/pk/asn1/der/generalizedtime/der_decode_generalizedtime.c
You could also align the definition of
DECODE_Vinder_decode_utctime.cwith the one inder_decode_generalizedtime.cby wrapping it indo { ... } while (0):From:
To: