From 4f0f0e75e2fefc2eb26da81f7a4fadf5d624875f Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Tue, 20 Dec 2011 03:08:09 -0200 Subject: [PATCH] Reduce ident by continuing early --- libkmod/libkmod-elf.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libkmod/libkmod-elf.c b/libkmod/libkmod-elf.c index 0d84d9f..4438120 100644 --- a/libkmod/libkmod-elf.c +++ b/libkmod/libkmod-elf.c @@ -420,14 +420,15 @@ int kmod_elf_get_strings(const struct kmod_elf *elf, const char *section, char * last = 0; for (i = 0, count = 0; i < size; i++) { - if (strings[i] == '\0') { - if (last == i) { - last = i + 1; - continue; - } - count++; + if (strings[i] != '\0') + continue; + + if (last == i) { last = i + 1; + continue; } + count++; + last = i + 1; } if (strings[i - 1] != '\0') count++; -- 2.7.4