com php-src: avoid strlen() usage in the loop: ext/standard/bas ic_functions.c
| From: | Anatol Belski | Date: | Wed, 17 Sep 2014 06:59:19 +0000 |
| Subject: | com php-src: avoid strlen() usage in the loop: ext/standard/bas ic_functions.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-81708@lists.php.net to get a copy of this message | ||
Commit: d41ac22a5418219581bef80ad57a63d8163265bb
Author: Anatol Belski <ab@php.net> Wed, 17 Sep 2014 08:59:19 +0200
Parents: d594809f2752e371d31647686ecec381b8015786
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d41ac22a5418219581bef80ad57a63d8163265bb
Log:
avoid strlen() usage in the loop
Changed paths:
M ext/standard/basic_functions.c
Diff:
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index de4d711..53aec26 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)