Commit 3d1a1781 authored by Vitaly Arbuzov's avatar Vitaly Arbuzov
Browse files

Don't add slot id to cursor when cluster mode is disabled

parent e110d9e2
...@@ -1141,12 +1141,14 @@ cleanup: ...@@ -1141,12 +1141,14 @@ cleanup:
} }
void addSlotIdToCursor(int slot, unsigned long long int *cursor) { void addSlotIdToCursor(int slot, unsigned long long int *cursor) {
if (!server.cluster_enabled) return;
/* Slot id can be -1 when iteration is over and there are no more slots to visit. */ /* Slot id can be -1 when iteration is over and there are no more slots to visit. */
if (slot < 0) return; if (slot < 0) return;
*cursor = (*cursor << CLUSTER_SLOT_MASK_BITS) | slot; *cursor = (*cursor << CLUSTER_SLOT_MASK_BITS) | slot;
} }
int getAndClearSlotIdFromCursor(unsigned long long int *cursor) { int getAndClearSlotIdFromCursor(unsigned long long int *cursor) {
if (!server.cluster_enabled) return 0;
int slot = (int) (*cursor & CLUSTER_SLOT_MASK); int slot = (int) (*cursor & CLUSTER_SLOT_MASK);
*cursor = ((*cursor) & ~CLUSTER_SLOT_MASK) >> CLUSTER_SLOT_MASK_BITS; *cursor = ((*cursor) & ~CLUSTER_SLOT_MASK) >> CLUSTER_SLOT_MASK_BITS;
return slot; return slot;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment