{"thread":{"id":"17713","subject":"[PATCH] Drop double-semicolon in C","startedAt":"2009-02-11T01:48:40Z","lastAt":"2009-02-11T01:48:40Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"104133","messageId":"7vfxiliw07.fsf@gitster.siamese.dyndns.org","threadId":"17713","inReplyTo":null,"subject":"[PATCH] Drop double-semicolon in C","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-11T01:48:40Z","receivedAt":"2009-02-11T01:48:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"The worst offenders are \"continue;;\" and \"break;;\" in switch statements.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * I think this is very trivial.  You can use\n\n   $ git grep -n -e ';;' --and --not -e 'for *(.*;;' -- '*.c'\n\n   to verify I caught all the bad ones.\n\n fast-import.c |    2 +-\n rerere.c      |    2 +-\n tree.c        |    2 +-\n walker.c      |    2 +-\n 4 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/fast-import.c b/fast-import.c\nindex 03b13e0..3ef3413 100644\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -869,7 +869,7 @@ static char *create_index(void)\n \t/* Generate the fan-out array. */\n \tc = idx;\n \tfor (i = 0; i < 256; i++) {\n-\t\tstruct object_entry **next = c;;\n+\t\tstruct object_entry **next = c;\n \t\twhile (next < last) {\n \t\t\tif ((*next)->sha1[0] != i)\n \t\t\t\tbreak;\ndiff --git a/rerere.c b/rerere.c\nindex 718fb52..3518207 100644\n--- a/rerere.c\n+++ b/rerere.c\n@@ -290,7 +290,7 @@ static int do_plain_rerere(struct string_list *rr, int fd)\n \t\t\thex = xstrdup(sha1_to_hex(sha1));\n \t\t\tstring_list_insert(path, rr)->util = hex;\n \t\t\tif (mkdir(git_path(\"rr-cache/%s\", hex), 0755))\n-\t\t\t\tcontinue;;\n+\t\t\t\tcontinue;\n \t\t\thandle_file(path, NULL, rr_path(hex, \"preimage\"));\n \t\t\tfprintf(stderr, \"Recorded preimage for '%s'\\n\", path);\n \t\t}\ndiff --git a/tree.c b/tree.c\nindex dfe4d5f..25d2e29 100644\n--- a/tree.c\n+++ b/tree.c\n@@ -110,7 +110,7 @@ int read_tree_recursive(struct tree *tree,\n \t\tcase 0:\n \t\t\tcontinue;\n \t\tcase READ_TREE_RECURSIVE:\n-\t\t\tbreak;;\n+\t\t\tbreak;\n \t\tdefault:\n \t\t\treturn -1;\n \t\t}\ndiff --git a/walker.c b/walker.c\nindex 679adab..e57630e 100644\n--- a/walker.c\n+++ b/walker.c\n@@ -18,7 +18,7 @@ void walker_say(struct walker *walker, const char *fmt, const char *hex)\n static void report_missing(const struct object *obj)\n {\n \tchar missing_hex[41];\n-\tstrcpy(missing_hex, sha1_to_hex(obj->sha1));;\n+\tstrcpy(missing_hex, sha1_to_hex(obj->sha1));\n \tfprintf(stderr, \"Cannot obtain needed %s %s\\n\",\n \t\tobj->type ? typename(obj->type): \"object\", missing_hex);\n \tif (!is_null_sha1(current_commit_sha1))\n-- \n1.6.2.rc0.36.g8307\n"}]}