From: Anatol Belski Date: Wed, 17 Sep 2014 06:59:19 +0000 (+0200) Subject: avoid strlen() usage in the loop X-Git-Tag: POST_NATIVE_TLS_MERGE^2~244 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d41ac22a5418219581bef80ad57a63d8163265bb;p=php avoid strlen() usage in the loop --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index de4d71106b..53aec268b0 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -4178,8 +4178,9 @@ static int parse_opts(char * opts, opt_struct ** result) { opt_struct * paras = NULL; unsigned int i, count = 0; + unsigned int opts_len = (unsigned int)strlen(opts); - for (i = 0; i < strlen(opts); i++) { + for (i = 0; i < opts_len; i++) { if ((opts[i] >= 48 && opts[i] <= 57) || (opts[i] >= 65 && opts[i] <= 90) || (opts[i] >= 97 && opts[i] <= 122)