MCPcopy Create free account
hub / github.com/ElementsProject/elements / ToNumber

Method ToNumber

src/leveldb/db/db_test.cc:1546–1555  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1544
1545 private:
1546 static int ToNumber(const Slice& x) {
1547 // Check that there are no extra characters.
1548 ASSERT_TRUE(x.size() >= 2 && x[0] == '[' && x[x.size() - 1] == ']')
1549 << EscapeString(x);
1550 int val;
1551 char ignored;
1552 ASSERT_TRUE(sscanf(x.ToString().c_str(), "[%i]%c", &val, &ignored) == 1)
1553 << EscapeString(x);
1554 return val;
1555 }
1556 };
1557 NumberComparator cmp;
1558 Options new_options = CurrentOptions();

Callers

nothing calls this directly

Calls 3

EscapeStringFunction · 0.85
sizeMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected