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

Function zdiff

src/t_zset.cpp:2539–2551  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2537}
2538
2539static void zdiff(zsetopsrc *src, long setnum, zset *dstzset, size_t *maxelelen, size_t *totelelen) {
2540 /* Skip everything if the smallest input is empty. */
2541 if (zuiLength(&src[0]) > 0) {
2542 int diff_algo = zsetChooseDiffAlgorithm(src, setnum);
2543 if (diff_algo == 1) {
2544 zdiffAlgorithm1(src, setnum, dstzset, maxelelen, totelelen);
2545 } else if (diff_algo == 2) {
2546 zdiffAlgorithm2(src, setnum, dstzset, maxelelen, totelelen);
2547 } else if (diff_algo != 0) {
2548 serverPanic("Unknown algorithm");
2549 }
2550 }
2551}
2552
2553uint64_t dictSdsHash(const void *key);
2554int dictSdsKeyCompare(void *privdata, const void *key1, const void *key2);

Callers 1

Calls 4

zuiLengthFunction · 0.85
zsetChooseDiffAlgorithmFunction · 0.85
zdiffAlgorithm1Function · 0.85
zdiffAlgorithm2Function · 0.85

Tested by

no test coverage detected