CLEANUP: atomic/tree-wide: replace single increments/decrements with inc/dec
This patch replaces roughly all occurrences of an HA_ATOMIC_ADD(&foo, 1)
or HA_ATOMIC_SUB(&foo, 1) with the equivalent HA_ATOMIC_INC(&foo) and
HA_ATOMIC_DEC(&foo) respectively. These are 507 changes over 45 files.
diff --git a/src/cache.c b/src/cache.c
index cffd63b..0eb6a88 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -1768,9 +1768,9 @@
return ACT_RET_CONT;
if (px == strm_fe(s))
- _HA_ATOMIC_ADD(&px->fe_counters.p.http.cache_lookups, 1);
+ _HA_ATOMIC_INC(&px->fe_counters.p.http.cache_lookups);
else
- _HA_ATOMIC_ADD(&px->be_counters.p.http.cache_lookups, 1);
+ _HA_ATOMIC_INC(&px->be_counters.p.http.cache_lookups);
shctx_lock(shctx_ptr(cache));
res = entry_exist(cache, s->txn->cache_hash);
@@ -1822,9 +1822,9 @@
should_send_notmodified_response(cache, htxbuf(&s->req.buf), res);
if (px == strm_fe(s))
- _HA_ATOMIC_ADD(&px->fe_counters.p.http.cache_hits, 1);
+ _HA_ATOMIC_INC(&px->fe_counters.p.http.cache_hits);
else
- _HA_ATOMIC_ADD(&px->be_counters.p.http.cache_hits, 1);
+ _HA_ATOMIC_INC(&px->be_counters.p.http.cache_hits);
return ACT_RET_CONT;
} else {
shctx_lock(shctx_ptr(cache));