Commit a0fcd0cf authored by Max Kellermann's avatar Max Kellermann

dirvec: don't call g_path_get_basename() on parameter

This overhead is completely useless, because no caller expects this behaviour.
parent 5d5c753c
......@@ -50,22 +50,15 @@ void dirvec_sort(struct dirvec *dv)
struct directory *dirvec_find(const struct dirvec *dv, const char *path)
{
char *base;
int i;
struct directory *ret = NULL;
base = g_path_get_basename(path);
db_lock();
for (i = dv->nr; --i >= 0; )
if (!strcmp(directory_get_name(dv->base[i]), base)) {
ret = dv->base[i];
break;
}
if (!strcmp(directory_get_name(dv->base[i]), path))
return dv->base[i];
db_unlock();
g_free(base);
return ret;
return NULL;
}
int dirvec_delete(struct dirvec *dv, struct directory *del)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment