]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: logs: rename a confusing local variable "curr_rg" to "smp_rg"
authorWilly Tarreau <w@1wt.eu>
Wed, 20 Sep 2023 18:25:14 +0000 (20:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 20 Sep 2023 19:38:33 +0000 (21:38 +0200)
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.

src/log.c

index b28b67e605739dd8687fb6e2cccbd5f7cb5af599..6cc8050c13768ee0d06ab3fded6a93c88a627267 100644 (file)
--- 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;
                                }