Remove unused variable
authorDaniel Gustafsson <dgustafsson@postgresql.org>
Wed, 6 Nov 2024 14:11:14 +0000 (15:11 +0100)
committerDaniel Gustafsson <dgustafsson@postgresql.org>
Wed, 6 Nov 2024 14:11:14 +0000 (15:11 +0100)
The low variable has not been used since it was added in d168b666823
and can be safely removed.  The variable is present in the Sedgewick
paper "Analysis of Shellsort and Related Algorithms" as a parameter
to the shellsort function, but our implementation does not use it.
Remove to improve readability of the code.

Author: Koki Nakamura <btnakamurakoukil@oss.nttdata.com>
Discussion: https://postgr.es/m/8aeb7b3eda53ca4c65fbacf8f43628fb@oss.nttdata.com

src/backend/access/heap/heapam.c

index 9a31cdcd096814744de6bd9511923900fad29774..d00300c5dcbcba170e83dd6e52bcd637e782fe82 100644 (file)
@@ -8302,7 +8302,6 @@ index_delete_sort(TM_IndexDeleteOp *delstate)
 {
    TM_IndexDelete *deltids = delstate->deltids;
    int         ndeltids = delstate->ndeltids;
-   int         low = 0;
 
    /*
     * Shellsort gap sequence (taken from Sedgewick-Incerpi paper).
@@ -8318,7 +8317,7 @@ index_delete_sort(TM_IndexDeleteOp *delstate)
 
    for (int g = 0; g < lengthof(gaps); g++)
    {
-       for (int hi = gaps[g], i = low + hi; i < ndeltids; i++)
+       for (int hi = gaps[g], i = hi; i < ndeltids; i++)
        {
            TM_IndexDelete d = deltids[i];
            int         j = i;