Bläddra i källkod

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 år sedan
förälder
incheckning
0d6a7f7228
1 ändrade filer med 1 tillägg och 1 borttagningar
  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