mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
replace handrolled for loop with TAILQ_FOREACH; from andres.p@zoho.com
This commit is contained in:
parent
47aa485fa2
commit
fbb0df4155
5
search.c
5
search.c
@ -223,9 +223,8 @@ search_match_exec(struct menu_q *menuq, struct menu_q *resultq, char *search)
|
|||||||
TAILQ_FOREACH(mi, menuq, entry) {
|
TAILQ_FOREACH(mi, menuq, entry) {
|
||||||
if (strsubmatch(search, mi->text, 1) == 0 &&
|
if (strsubmatch(search, mi->text, 1) == 0 &&
|
||||||
fnmatch(search, mi->text, 0) == FNM_NOMATCH)
|
fnmatch(search, mi->text, 0) == FNM_NOMATCH)
|
||||||
continue;
|
continue;
|
||||||
for (mj = TAILQ_FIRST(resultq); mj != NULL;
|
TAILQ_FOREACH(mj, resultq, resultentry) {
|
||||||
mj = TAILQ_NEXT(mj, resultentry)) {
|
|
||||||
if (strcasecmp(mi->text, mj->text) < 0) {
|
if (strcasecmp(mi->text, mj->text) < 0) {
|
||||||
TAILQ_INSERT_BEFORE(mj, mi, resultentry);
|
TAILQ_INSERT_BEFORE(mj, mi, resultentry);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user