Thread: Remove unnecessary commas for goto labels
Hi hackers, I find there are some unnecessary commas for goto lables, attached a patch to remove them. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd. From 3ac7d03e1c5d81e883406ac62fafbe7e7d32fd1e Mon Sep 17 00:00:00 2001 From: Japin Li <japinli@hotmail.com> Date: Sun, 9 Oct 2022 07:35:43 +0800 Subject: [PATCH v1 1/1] Remove unnecessary commas for goto labels --- src/backend/access/transam/slru.c | 2 +- src/backend/executor/nodeModifyTable.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/access/transam/slru.c b/src/backend/access/transam/slru.c index b65cb49d7f..6c57fae312 100644 --- a/src/backend/access/transam/slru.c +++ b/src/backend/access/transam/slru.c @@ -1239,7 +1239,7 @@ SimpleLruTruncate(SlruCtl ctl, int cutoffPage) */ LWLockAcquire(shared->ControlLock, LW_EXCLUSIVE); -restart:; +restart: /* * While we are holding the lock, make an important safety check: the diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c index 04454ad6e6..447f7bc2fb 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c @@ -1373,7 +1373,7 @@ ExecDelete(ModifyTableContext *context, * special-case behavior needed for referential integrity updates in * transaction-snapshot mode transactions. */ -ldelete:; +ldelete: result = ExecDeleteAct(context, resultRelInfo, tupleid, changingPart); switch (result) @@ -1855,7 +1855,7 @@ ExecUpdateAct(ModifyTableContext *context, ResultRelInfo *resultRelInfo, * then trigger.c will have done table_tuple_lock to lock the correct * tuple, so there's no need to do them again.) */ -lreplace:; +lreplace: /* ensure slot is independent, consider e.g. EPQ */ ExecMaterializeSlot(slot); @@ -2686,7 +2686,7 @@ ExecMergeMatched(ModifyTableContext *context, ResultRelInfo *resultRelInfo, econtext->ecxt_innertuple = context->planSlot; econtext->ecxt_outertuple = NULL; -lmerge_matched:; +lmerge_matched: /* * This routine is only invoked for matched rows, and we must have found -- 2.17.1
Hi, On Sun, Oct 09, 2022 at 07:42:58AM +0800, Japin Li wrote: > > Hi hackers, > > I find there are some unnecessary commas for goto lables, > attached a patch to remove them. You mean semi-colon? +1, and a quick regex later I don't see any other occurrence.
On Sun, 09 Oct 2022 at 11:07, Julien Rouhaud <rjuju123@gmail.com> wrote: > Hi, > > On Sun, Oct 09, 2022 at 07:42:58AM +0800, Japin Li wrote: >> >> Hi hackers, >> >> I find there are some unnecessary commas for goto lables, >> attached a patch to remove them. > > You mean semi-colon? +1, and a quick regex later I don't see any other > occurrence. Yeah semi-colon, sorry for the typo. -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.
On Sun, Oct 9, 2022 at 10:08 AM Julien Rouhaud <rjuju123@gmail.com> wrote:
>
> Hi,
>
> On Sun, Oct 09, 2022 at 07:42:58AM +0800, Japin Li wrote:
> >
> > Hi hackers,
> >
> > I find there are some unnecessary commas for goto lables,
> > attached a patch to remove them.
>
> You mean semi-colon? +1, and a quick regex later I don't see any other
> occurrence.
Interestingly, I did find that in C, some statement is needed after a label, even an empty one, otherwise it won't compile. That's not the case here, though, so pushed.
--
John Naylor
EDB: http://www.enterprisedb.com
On Mon, 10 Oct 2022 at 16:18, John Naylor <john.naylor@enterprisedb.com> wrote: > Interestingly, I did find that in C, some statement is needed after a > label, even an empty one, otherwise it won't compile. Yeah, this is required by ISO C [1]. > That's not the case here, though, so pushed. Thank you! [1] https://www.gnu.org/software/gnu-c-manual/gnu-c-manual.html#Labels -- Regrads, Japin Li. ChengDu WenWu Information Technology Co.,Ltd.