{"thread":{"id":"37009","subject":"[PATCH] submodule.c: use the ARRAY_SIZE macro","startedAt":"2014-06-27T12:11:39Z","lastAt":"2014-06-27T12:11:39Z","messageCount":1,"participants":["Elia Pinto"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"245064","messageId":"1403871099-30620-1-git-send-email-gitter.spiros@gmail.com","threadId":"37009","inReplyTo":null,"subject":"[PATCH] submodule.c: use the ARRAY_SIZE macro","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-27T12:11:39Z","receivedAt":"2014-06-27T12:11:39Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Use the ARRAY_SIZE macro to get the number\nof elements in an array.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n submodule.c |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/submodule.c b/submodule.c\nindex b80ecac..48e3b44 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -965,7 +965,7 @@ static int find_first_merges(struct object_array *result, const char *path,\n \t\t\tsha1_to_hex(a->object.sha1));\n \tinit_revisions(&revs, NULL);\n \trev_opts.submodule = path;\n-\tsetup_revisions(sizeof(rev_args)/sizeof(char *)-1, rev_args, &revs, &rev_opts);\n+\tsetup_revisions(ARRAY_SIZE(rev_args)-1, rev_args, &revs, &rev_opts);\n \n \t/* save all revisions from the above list that contain b */\n \tif (prepare_revision_walk(&revs))\n-- \n1.7.10.4\n"}]}