Remove duplicate lines of code
authorDaniel Gustafsson
Mon, 24 Apr 2023 09:16:17 +0000 (11:16 +0200)
committerDaniel Gustafsson
Mon, 24 Apr 2023 09:16:17 +0000 (11:16 +0200)
Commit 6df7a9698bb accidentally included two identical prototypes for
default_multirange_selectivi() and commit 086cf1458c6 added a break;
statement where one was already present, thus duplicating it.  While
there is no bug caused by this, fix by removing the duplicated lines
as they provide no value.

Backpatch the fix for duplicate prototypes to v14 and the duplicate
break statement fix to all supported branches to avoid backpatching
hazards due to the removal.

Reported-by: Anton Voloshin
Discussion: https://postgr.es/m/0e69cb60-0176-f6d0-7e15-6478b7d85724@postgrespro.ru

src/backend/utils/adt/multirangetypes_selfuncs.c
src/interfaces/ecpg/preproc/variable.c

index e9326f8342a7a8e99e713de452122ee2ed9cc188..cefc4710fd473427894604d9af7c3d9f00495b62 100644 (file)
@@ -35,7 +35,6 @@ static double calc_multirangesel(TypeCacheEntry *typcache,
                                 VariableStatData *vardata,
                                 const MultirangeType *constval, Oid operator);
 static double default_multirange_selectivity(Oid operator);
-static double default_multirange_selectivity(Oid operator);
 static double calc_hist_selectivity(TypeCacheEntry *typcache,
                                    VariableStatData *vardata,
                                    const MultirangeType *constval,
index 2a2b9531187affa91001a50c5a59de1de77da164..b23ed5edf460f2fe5379e3e1051c31ca5e2bbb6d 100644 (file)
@@ -105,7 +105,6 @@ find_struct_member(char *name, char *str, struct ECPGstruct_member *members, int
                        else
                            return find_struct_member(name, ++end, members->type->u.members, brace_level);
                        break;
-                       break;
                    case '.':
                        if (members->type->type == ECPGt_array)
                            return find_struct_member(name, end, members->type->u.element->u.members, brace_level);