]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: stick-tables: Don't needlessly compute shard number in stksess_free()
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 12 Nov 2025 16:59:24 +0000 (17:59 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 14 Nov 2025 10:56:14 +0000 (11:56 +0100)
Since commit 0bda33a3e ("MINOR: stick-tables: remove the uneeded read lock
in stksess_free()"), the lock on the shard is no longer acquired. So it is
useless to still compture the shard number. The result is never used and can
be safely removed.

src/stick_table.c

index be5db167b7e1078873b891aaf89d081e0af27eec..d33c42e5aa146de5bc77b89180e09589ed5234da 100644 (file)
@@ -101,8 +101,6 @@ void __stksess_free(struct stktable *t, struct stksess *ts)
  */
 void stksess_free(struct stktable *t, struct stksess *ts)
 {
-       uint shard;
-       size_t len;
        void *data;
 
        data = stktable_data_ptr(t, ts, STKTABLE_DT_SERVER_KEY);
@@ -111,16 +109,6 @@ void stksess_free(struct stktable *t, struct stksess *ts)
                stktable_data_cast(data, std_t_dict) = NULL;
        }
 
-       if (t->type == SMP_T_STR)
-               len = strlen((const char *)ts->key.key);
-       else
-               len = t->key_size;
-
-       shard = stktable_calc_shard_num(t, ts->key.key, len);
-
-       /* make the compiler happy when shard is not used without threads */
-       ALREADY_CHECKED(shard);
-
        __stksess_free(t, ts);
 }