MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / _intsetValueEncoding

Function _intsetValueEncoding

src/intset.c:46–53  ·  view source on GitHub ↗

Return the required encoding for the provided value. */

Source from the content-addressed store, hash-verified

44
45/* Return the required encoding for the provided value. */
46static uint8_t _intsetValueEncoding(int64_t v) {
47 if (v < INT32_MIN || v > INT32_MAX)
48 return INTSET_ENC_INT64;
49 else if (v < INT16_MIN || v > INT16_MAX)
50 return INTSET_ENC_INT32;
51 else
52 return INTSET_ENC_INT16;
53}
54
55/* Return the value at pos, given an encoding. */
56static int64_t _intsetGetEncoded(intset *is, int pos, uint8_t enc) {

Callers 5

intsetUpgradeAndAddFunction · 0.85
intsetAddFunction · 0.85
intsetRemoveFunction · 0.85
intsetFindFunction · 0.85
intsetTestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected