[pve-devel] [PATCH] path_is_lockdir: optimize away a strlen call
Wolfgang Bumiller
w.bumiller at proxmox.com
Wed Jun 3 13:55:54 CEST 2015
---
data/src/cfs-utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/data/src/cfs-utils.c b/data/src/cfs-utils.c
index d25b858..2c91621 100644
--- a/data/src/cfs-utils.c
+++ b/data/src/cfs-utils.c
@@ -332,5 +332,5 @@ path_is_lockdir(const char *path)
{
while (*path == '/') path++;
- return (strncmp(path, "priv/lock/", 10) == 0) && (strlen(path) > 10);
+ return (strncmp(path, "priv/lock/", 10) == 0) && path[10];
}
--
2.1.4
More information about the pve-devel
mailing list