Refactor c/isogram/length to exclude null char

Since we're no longer copying, we don't need to include that char in our
length. It just adds an extra iteration step.
This commit is contained in:
dwrz
2019-02-24 15:51:30 +00:00
parent 004533a2cb
commit 8519977157
+1 -1
View File
@@ -4,7 +4,7 @@
int length(const char string[]) {
int i = 0;
while (string[i] != '\0') { i++; }
return i+1; // Account for terminating null char.
return i;
}
char lowercase(char c) {