summaryrefslogtreecommitdiff
path: root/src/configparser.y
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2019-10-02 01:54:15 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2020-02-24 11:15:32 -0500
commitb2991c686da3c8dbdd7d056b0eaf316af1428a79 (patch)
tree4c01182e42f85810d307bfb2d978c366745f2766 /src/configparser.y
parent2fd0faf1bfeae09bbd683e656f59fbe7d8de8e74 (diff)
downloadlighttpd-git-b2991c686da3c8dbdd7d056b0eaf316af1428a79.tar.gz
[core] perf: array.c performance enhancements
mark array_get_index() as hot, rewrite to be pure and return sorted pos mark routines as pure, as appropriate mark routines as cold if used only at startup for config processing mark params const, as appropriate array_get_buf_ptr() for modifiable value buffer after insert into array uint32_t used and size members instead of size_t remove a->unique_ndx member; simply add to end of array for value lists remove du->is_index_key member; simply check buffer_is_empty(du->key) array_insert_key_value() used to be a hint that lookup could be skipped, but the state from array_get_index() is now saved and reused internally, so the distinction is no longer needed. Use array_set_key_value().
Diffstat (limited to 'src/configparser.y')
-rw-r--r--src/configparser.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/configparser.y b/src/configparser.y
index 60b6a67c..39b54236 100644
--- a/src/configparser.y
+++ b/src/configparser.y
@@ -99,7 +99,7 @@ static data_unset *configparser_merge_data(data_unset *op1, const data_unset *op
for (i = 0; i < src->used; i ++) {
du = (data_unset *)src->data[i];
if (du) {
- if (du->is_index_key || buffer_is_empty(du->key) || !array_get_element_klen(dst, CONST_BUF_LEN(du->key))) {
+ if (buffer_is_empty(du->key) || !array_get_element_klen(dst, CONST_BUF_LEN(du->key))) {
array_insert_unique(dst, du->fn->copy(du));
} else {
fprintf(stderr, "Duplicate array-key '%s'\n", du->key->ptr);