avoid unnecessary strlen() call in find_entry_by_name()
diff --git a/lib/object.c b/lib/object.c
index 77ebb79..0532771 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -714,8 +714,7 @@ find_entry_by_name(struct got_tree_object *tree, const char *name, size_t len)
struct got_tree_entry *te;
SIMPLEQ_FOREACH(te, &tree->entries.head, entry) {
- if (strlen(te->name) == len &&
- strncmp(te->name, name, len) == 0)
+ if (strncmp(te->name, name, len) == 0 && te->name[len] == '\0')
return te;
}
return NULL;