lua: optimize docmd, don't check len and use const

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-07-10 15:11:23 +02:00
parent 677e6355c5
commit 41d66ebf29
1 changed files with 8 additions and 9 deletions

11
lua.c
View File

@ -604,16 +604,15 @@ luaA_parserc(const char *confpatharg)
* \return true on succes, false on failure.
*/
static void
luaA_docmd(char *cmd)
luaA_docmd(const char *cmd)
{
char *p, *curcmd = cmd;
char *p;
if(a_strlen(cmd))
while((p = strchr(curcmd, '\n')))
while((p = strchr(cmd, '\n')))
{
*p = '\0';
luaA_dostring(globalconf.L, curcmd);
curcmd = p + 1;
luaA_dostring(globalconf.L, cmd);
cmd = p + 1;
}
}