Utils: ring: Remove unused code.
This commit is contained in:
parent
f0ff18d35c
commit
b757f94107
31
utils/ring.h
31
utils/ring.h
|
@ -63,24 +63,6 @@
|
||||||
} \
|
} \
|
||||||
element->r_next = element->r_prev = 0
|
element->r_next = element->r_prev = 0
|
||||||
|
|
||||||
/** Find the element (by hostname) in the given ring, leave it in the
|
|
||||||
* provided element variable
|
|
||||||
*/
|
|
||||||
#define RING_FINDBYHOST(ring, element, hostname) \
|
|
||||||
/*LOG("RING_FINDBYHOST(%s, %s)", #ring, hostname);*/ \
|
|
||||||
if (ring) { \
|
|
||||||
bool found = false; \
|
|
||||||
element = ring; \
|
|
||||||
do { \
|
|
||||||
if (strcasecmp(element->host, hostname) == 0) { \
|
|
||||||
found = true; \
|
|
||||||
break; \
|
|
||||||
} \
|
|
||||||
element = element->r_next; \
|
|
||||||
} while (element != ring); \
|
|
||||||
if (!found) element = 0; \
|
|
||||||
} else element = 0
|
|
||||||
|
|
||||||
/** Find the element (by hostname) in the given ring, leave it in the
|
/** Find the element (by hostname) in the given ring, leave it in the
|
||||||
* provided element variable
|
* provided element variable
|
||||||
*/
|
*/
|
||||||
|
@ -112,19 +94,6 @@
|
||||||
} while (p != ring); \
|
} while (p != ring); \
|
||||||
} else sizevar = 0
|
} else sizevar = 0
|
||||||
|
|
||||||
/** Count the number of elements in the ring which match the provided hostname */
|
|
||||||
#define RING_COUNTBYHOST(ringtype, ring, sizevar, hostname) \
|
|
||||||
/*LOG("RING_COUNTBYHOST(%s, %s)", #ring, hostname);*/ \
|
|
||||||
if (ring) { \
|
|
||||||
ringtype *p = ring; \
|
|
||||||
sizevar = 0; \
|
|
||||||
do { \
|
|
||||||
if (strcasecmp(p->host, hostname) == 0) \
|
|
||||||
sizevar++; \
|
|
||||||
p = p->r_next; \
|
|
||||||
} while (p != ring); \
|
|
||||||
} else sizevar = 0
|
|
||||||
|
|
||||||
/** Count the number of elements in the ring which match the provided lwc_hostname */
|
/** Count the number of elements in the ring which match the provided lwc_hostname */
|
||||||
#define RING_COUNTBYLWCHOST(ringtype, ring, sizevar, lwc_hostname) \
|
#define RING_COUNTBYLWCHOST(ringtype, ring, sizevar, lwc_hostname) \
|
||||||
/*LOG("RING_COUNTBYHOST(%s, %s)", #ring, hostname);*/ \
|
/*LOG("RING_COUNTBYHOST(%s, %s)", #ring, hostname);*/ \
|
||||||
|
|
Loading…
Reference in New Issue