Skip to content
Myr

main: write_cache(): application list is already sorted

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Daniel Eklöf · committed by Daniel Eklöf · parent cf61428 · Browse files · 1 file+1 added−11 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−11 removed

  • other:+1 added−11 removed

1 file+1 added−11 removed

modified:main.c+1 added-11 removed
1125 unmodified lines
1126 tll_free(cache_data);1127 munmap(text, st.st_size);1128}11291130static int1131sort_application_by_title(const void *_a, const void *_b)1132{1133 const struct application *a = _a;1134 const struct application *b = _b;1135 return strcmp(a->title, b->title);1136}11371130static void1139write_cache(struct application_list *apps)1131write_cache(const struct application_list *apps)1132{1133 const char *path = xdg_cache_dir();1134 if (path == NULL) {1135 LOG_WARN("failed to get cache directory: not saving popularity cache");
13 unmodified lines
1149 LOG_ERRNO("%s/f00sel: failed to open", path);1150 return;1151 }11521161 qsort(apps->v, apps->count, sizeof(apps->v[0]), &sort_application_by_title);11621153 for (size_t i = 0; i < apps->count; i++) {1154 if (apps->v[i].count == 0)1155 continue;1156
430 unmodified lines