diff options
| author | xXx-caillou-xXx | 2018-07-13 10:36:50 +0200 |
|---|---|---|
| committer | jvoisin | 2018-07-13 08:36:50 +0000 |
| commit | 7963580d72a358975133f86f01de2d2eab08ba38 (patch) | |
| tree | 4bec345d70f687a2a6002b36e2f2fc79318959f6 /src/sp_var_value.c | |
| parent | 12b740bc7bb01ffe397cecc5b6fa25b136304911 (diff) | |
Massively optimize how rules are handled
This commit does a lot of things:
- Use hashtables instead of lists to store the rules
- Rules that can be applied at launch time won't be tried at runtime
- Improve feedback when writing nonsensical rules
- Make intensive use of `zend_string` instead of `char*`
Diffstat (limited to 'src/sp_var_value.c')
| -rw-r--r-- | src/sp_var_value.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/sp_var_value.c b/src/sp_var_value.c index 7ed8dfa..e91c3d8 100644 --- a/src/sp_var_value.c +++ b/src/sp_var_value.c | |||
| @@ -107,10 +107,9 @@ static zval *get_array_value(zend_execute_data *ed, zval *zvalue, | |||
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | if (Z_TYPE_P(zvalue) == IS_ARRAY) { | 109 | if (Z_TYPE_P(zvalue) == IS_ARRAY) { |
| 110 | char *idx = sp_convert_to_string(idx_value); | 110 | const zend_string *idx = sp_zval_to_zend_string(idx_value); |
| 111 | zval *ret = get_entry_hashtable(Z_ARRVAL_P(zvalue), idx, strlen(idx)); | 111 | return get_entry_hashtable(Z_ARRVAL_P(zvalue), ZSTR_VAL(idx), |
| 112 | efree(idx); | 112 | ZSTR_LEN(idx)); |
| 113 | return ret; | ||
| 114 | } | 113 | } |
| 115 | 114 | ||
| 116 | return NULL; | 115 | return NULL; |
