int OnKeyValue(KeyObject* k, ValueObject* v, uint32 cursor) { ZSetKeyObject* zsk = (ZSetKeyObject*) k; bool need_delete = false; need_delete = z_containmin ? zsk->score >= z_min_score : zsk->score > z_min_score; if (need_delete) { need_delete = z_containmax ? zsk->score <= z_max_score : zsk->score < z_max_score; } if (need_delete) { ZSetScoreKeyObject zk(zsk->key, zsk->value, zsk->db); z_db->DelValue(zk); z_db->DelValue(*zsk); z_meta.size--; z_count++; } if (zsk->score == z_max_score) { return -1; } return 0; }
int OnKeyValue(KeyObject* k, ValueObject* value, uint32 cursor) { ZSetKeyObject* sek = (ZSetKeyObject*) k; ZSetScoreKeyObject tmp(sek->key, sek->value, sek->db); z_db->DelValue(*sek); z_db->DelValue(tmp); return 0; }
int OnKeyValue(KeyObject* k, ValueObject* value, uint32 cursor) { ZSetKeyObject* sek = (ZSetKeyObject*) k; ZSetScoreKeyObject tmp(sek->key, sek->value, sek->db); vs.push_back(sek->value); count--; z_db->DelValue(*sek); z_db->DelValue(tmp); if (count == 0) { return -1; } return 0; }
int OnKeyValue(KeyObject* k, ValueObject* v, uint32 cursor) { ZSetKeyObject* zsk = (ZSetKeyObject*) k; if (rank >= z_start && rank <= z_stop) { ZSetScoreKeyObject zk(zsk->key, zsk->value, zsk->db); z_db->DelValue(zk); z_db->DelValue(*zsk); z_meta.size--; z_count++; } rank++; if (rank > z_stop) { return -1; } return 0; }