From a677b18b2d8d34fead041b7808675c23c0041ac0 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 7 Oct 2018 05:22:03 +0000 Subject: [PATCH] Hoist strlen() outside loop in osdfunc_listsymbols() git-svn-id: https://svn.eduke32.com/eduke32@7024 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/osd.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/build/src/osd.cpp b/source/build/src/osd.cpp index b4a18e098..5d85d167b 100644 --- a/source/build/src/osd.cpp +++ b/source/build/src/osd.cpp @@ -508,9 +508,11 @@ static int32_t osdfunc_listsymbols(osdfuncparm_t const * const parm) else OSD_Printf("%sSymbol listing:\n", osd->draw.highlight); + int const parmlen = Bstrlen(parm->parms[0]); + for (i=symbols; i!=NULL; i=i->next) { - if (i->func == OSD_UNALIASED || (parm->numparms == 1 && Bstrncmp(parm->parms[0], i->name, Bstrlen(parm->parms[0])))) + if (i->func == OSD_UNALIASED || (parm->numparms == 1 && Bstrncmp(parm->parms[0], i->name, parmlen))) continue; {