MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / dinibble2int

Function dinibble2int

src/rustDemangle.cpp:470–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

468}
469
470static NODISCARD bool dinibble2int(const char *buf, uint8_t *result) {
471 uint8_t result_val = 0;
472 for (int i = 0; i < 2; i++) {
473 char c = buf[i];
474 result_val <<= 4;
475 if ('0' <= c && c <= '9') {
476 result_val += c - '0';
477 } else if ('a' <= c && c <= 'f') {
478 result_val += 10 + (c - 'a');
479 } else {
480 return false;
481 }
482 }
483 *result = result_val;
484 return true;
485}
486
487
488typedef enum {

Calls

no outgoing calls

Tested by

no test coverage detected