Преглед изворни кода

u-a: Do not use strlen() to check for non-empty string in fileset_has_slave()

We only need to check if the first character is not NUL, doing a
strlen() is just wasteful.
Guillem Jover пре 14 година
родитељ
комит
0d6a7f7228
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      utils/update-alternatives.c

+ 1 - 1
utils/update-alternatives.c

@@ -660,7 +660,7 @@ fileset_has_slave(struct fileset *fs, const char *name)
 	if (file == NULL)
 		return false;
 
-	return strlen(file) ? true : false;
+	return file[0] != '\0';
 }
 
 static bool