File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -77,36 +77,36 @@ php_canonicalize_version(const char *version)
77
77
78
78
typedef struct {
79
79
const char * name ;
80
+ uint8_t name_len ;
80
81
int order ;
81
82
} special_forms_t ;
82
83
83
- static int
84
- compare_special_version_forms (char * form1 , char * form2 )
84
+ static int compare_special_version_forms (char * form1 , char * form2 )
85
85
{
86
86
int found1 = -1 , found2 = -1 ;
87
87
special_forms_t special_forms [11 ] = {
88
- {"dev" , 0 },
89
- {"alpha" , 1 },
90
- {"a" , 1 },
91
- {"beta" , 2 },
92
- {"b" , 2 },
93
- {"RC" , 3 },
94
- {"rc" , 3 },
95
- {"#" , 4 },
96
- {"pl" , 5 },
97
- {"p" , 5 },
98
- {NULL , 0 },
88
+ {ZEND_STRL ( "dev" ) , 0 },
89
+ {ZEND_STRL ( "alpha" ) , 1 },
90
+ {ZEND_STRL ( "a" ) , 1 },
91
+ {ZEND_STRL ( "beta" ) , 2 },
92
+ {ZEND_STRL ( "b" ) , 2 },
93
+ {ZEND_STRL ( "RC" ) , 3 },
94
+ {ZEND_STRL ( "rc" ) , 3 },
95
+ {ZEND_STRL ( "#" ) , 4 },
96
+ {ZEND_STRL ( "pl" ) , 5 },
97
+ {ZEND_STRL ( "p" ) , 5 },
98
+ {NULL , 0 , 0 },
99
99
};
100
100
special_forms_t * pp ;
101
101
102
102
for (pp = special_forms ; pp && pp -> name ; pp ++ ) {
103
- if (strncmp (form1 , pp -> name , strlen ( pp -> name ) ) == 0 ) {
103
+ if (strncmp (form1 , pp -> name , pp -> name_len ) == 0 ) {
104
104
found1 = pp -> order ;
105
105
break ;
106
106
}
107
107
}
108
108
for (pp = special_forms ; pp && pp -> name ; pp ++ ) {
109
- if (strncmp (form2 , pp -> name , strlen ( pp -> name ) ) == 0 ) {
109
+ if (strncmp (form2 , pp -> name , pp -> name_len ) == 0 ) {
110
110
found2 = pp -> order ;
111
111
break ;
112
112
}
You can’t perform that action at this time.
0 commit comments