MCPcopy Create free account
hub / github.com/F-Stack/f-stack / _intsetSet

Function _intsetSet

app/redis-6.2.6/src/intset.c:82–95  ·  view source on GitHub ↗

Set the value at pos, using the configured encoding. */

Source from the content-addressed store, hash-verified

80
81/* Set the value at pos, using the configured encoding. */
82static void _intsetSet(intset *is, int pos, int64_t value) {
83 uint32_t encoding = intrev32ifbe(is->encoding);
84
85 if (encoding == INTSET_ENC_INT64) {
86 ((int64_t*)is->contents)[pos] = value;
87 memrev64ifbe(((int64_t*)is->contents)+pos);
88 } else if (encoding == INTSET_ENC_INT32) {
89 ((int32_t*)is->contents)[pos] = value;
90 memrev32ifbe(((int32_t*)is->contents)+pos);
91 } else {
92 ((int16_t*)is->contents)[pos] = value;
93 memrev16ifbe(((int16_t*)is->contents)+pos);
94 }
95}
96
97/* Create an empty intset. */
98intset *intsetNew(void) {

Callers 2

intsetUpgradeAndAddFunction · 0.85
intsetAddFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected