Introduction
Introduction Statistics Contact Development Disclaimer Help
improve performance of case-insensitive matching - dmenu - dynamic menu
git clone git://git.suckless.org/dmenu
Log
Files
Refs
README
LICENSE
---
commit eb96af27f4059c93d7e000e910b71d74829a239b
parent d78ff08d99780a73447d5a95bf1e358e8c23aa3c
Author: Hiltjo Posthuma <[email protected]>
Date: Mon, 7 Feb 2022 00:21:12 +0100
improve performance of case-insensitive matching
Diffstat:
M dmenu.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
---
diff --git a/dmenu.c b/dmenu.c
@@ -102,17 +102,6 @@ cleanup(void)
XCloseDisplay(dpy);
}
-static char *
-cistrstr(const char *s, const char *sub)
-{
- size_t len;
-
- for (len = strlen(sub); *s; s++)
- if (!strncasecmp(s, sub, len))
- return (char *)s;
- return NULL;
-}
-
static int
drawitem(struct item *item, int x, int y, int w)
{
@@ -722,7 +711,7 @@ main(int argc, char *argv[])
fast = 1;
else if (!strcmp(argv[i], "-i")) { /* case-insensitive item ma…
fstrncmp = strncasecmp;
- fstrstr = cistrstr;
+ fstrstr = strcasestr;
} else if (i + 1 == argc)
usage();
/* these options take one argument */
You are viewing proxied material from suckless.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.