From: Willy Tarreau Date: Wed, 20 Sep 2023 18:25:14 +0000 (+0200) Subject: CLEANUP: logs: rename a confusing local variable "curr_rg" to "smp_rg" X-Git-Tag: v2.9-dev6~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49ddc0138cfeacde8701a029a0878ea3bfa2988f;p=thirdparty%2Fhaproxy.git CLEANUP: logs: rename a confusing local variable "curr_rg" to "smp_rg" The variable curr_rg in process_send_log() is misleading because it is not related to the integer curr_rg that's used to calculate it, instead it's a pointer to the current smp_log_range from smp_rgs[], so let's call it "smp_rg" as a singular for this "smp_rgs" and put an end to this confusion. --- diff --git a/src/log.c b/src/log.c index b28b67e605..6cc8050c13 100644 --- a/src/log.c +++ b/src/log.c @@ -1829,18 +1829,18 @@ void process_send_log(struct list *logsrvs, int level, int facility, continue; if (logsrv->lb.smp_rgs) { - struct smp_log_range *curr_rg; + struct smp_log_range *smp_rg; unsigned int next_idx; HA_SPIN_LOCK(LOGSRV_LOCK, &logsrv->lock); next_idx = logsrv->lb.curr_idx + 1; - curr_rg = &logsrv->lb.smp_rgs[logsrv->lb.curr_rg]; + smp_rg = &logsrv->lb.smp_rgs[logsrv->lb.curr_rg]; /* check if the index we're going to take is within range */ - in_range = curr_rg->low <= next_idx && next_idx <= curr_rg->high; + in_range = smp_rg->low <= next_idx && next_idx <= smp_rg->high; if (in_range) { /* Let's consume this range. */ - if (next_idx == curr_rg->high) { + if (next_idx == smp_rg->high) { /* If consumed, let's select the next range. */ logsrv->lb.curr_rg = (logsrv->lb.curr_rg + 1) % logsrv->lb.smp_rgs_sz; }