removed use of pointer to iterators, spurious function calls and made the function noexcept
- Group Reviewers
Restricted Owners Package (Owns No Changed Paths) Restricted Project
wrote a local cpp test testing many possible hex strings including the "" and "0x" edge cases to make sure function behaves appropriately.
also forced substr to throw out_of_range - substr(-1,x) - and made sure it is caught so the 'noexcept' isn't a lie
While the change isn't bad per se, this is actually not helping. This code is maintained today by the Core developers and taking ownership of it just increase our maintenance burden. Without a direct benefit, this is hard to justify.
As an aside, this may allocate memory - though most stdlib will do SSO in practice for 2 chars. Allocating when you can avoid is usually a pretty bad idea.