Changeset dfab1e
- Timestamp:
- 03/09/08 17:14:01 (4 years ago)
- Branches:
- master, ketama-compat
- Children:
- 3760ea
- Parents:
- 2986b7
- git-author:
- Tomash Brechko <tomash.brechko@…> (03/09/08 17:14:01)
- git-committer:
- Tomash Brechko <tomash.brechko@…> (03/09/08 17:14:01)
- File:
-
- 1 edited
-
src/dispatch_key.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/dispatch_key.c
r2986b7 rdfab1e 186 186 if (! array_empty(state->buckets)) 187 187 { 188 struct continuum_point *end = 189 array_end(state->buckets, struct continuum_point); 190 188 191 p = dispatch_find_bucket(state, point); 189 192 … … 192 195 && point > p->point) 193 196 { 194 p = array_end(state->buckets, struct continuum_point);197 p = end; 195 198 } 196 199 else 197 200 { 198 if (point == p->point) 199 { 200 /* 201 Even if there's a server for the same point 202 already, we have to add ours, because the first 203 one may be removed later. But we add ours after 204 the first server for not to change key 205 distribution. 206 */ 207 ++p; 208 } 201 /* 202 Even if there's a server for the same point already, 203 we have to add ours, because the first one may be 204 removed later. But we add ours after the old servers 205 for not to change key distribution. 206 */ 207 while (p != end && p->point == point) 208 ++p; 209 209 210 210 /* Move the tail one position forward. */ 211 memmove(p + 1, p, 212 ((array_end(state->buckets, struct continuum_point) - p) 213 * sizeof(*p))); 211 if (p != end) 212 memmove(p + 1, p, (end - p) * sizeof(*p)); 214 213 } 215 214 }
Note: See TracChangeset
for help on using the changeset viewer.
