Skip to content

Commit

Permalink
[core] rename variable in array.c
Browse files Browse the repository at this point in the history
From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3099 152afb58-edef-0310-8abb-c4023f1b3aa9
  • Loading branch information
stbuehler committed Mar 15, 2016
1 parent 8d8ae9c commit be121a6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/array.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,20 +171,20 @@ void array_set_key_value(array *hdrs, const char *key, size_t key_len, const cha
}

/* if entry already exists return pointer to existing entry, otherwise insert entry and return NULL */
static data_unset **array_find_or_insert(array *a, data_unset *str) {
static data_unset **array_find_or_insert(array *a, data_unset *entry) {
int ndx = -1;
int pos = 0;
size_t j;

/* generate unique index if neccesary */
if (buffer_is_empty(str->key) || str->is_index_key) {
buffer_copy_int(str->key, a->unique_ndx++);
str->is_index_key = 1;
if (buffer_is_empty(entry->key) || entry->is_index_key) {
buffer_copy_int(entry->key, a->unique_ndx++);
entry->is_index_key = 1;
force_assert(0 != a->unique_ndx); /* must not wrap or we'll get problems */
}

/* try to find the string */
if (-1 != (ndx = array_get_index(a, CONST_BUF_LEN(str->key), &pos))) {
/* try to find the entry */
if (-1 != (ndx = array_get_index(a, CONST_BUF_LEN(entry->key), &pos))) {
/* found collision, return it */
return &a->data[ndx];
}
Expand Down Expand Up @@ -217,11 +217,11 @@ static data_unset **array_find_or_insert(array *a, data_unset *str) {
/* make sure there is nothing here */
if (a->data[ndx]) a->data[ndx]->free(a->data[ndx]);

a->data[a->used++] = str;
a->data[a->used++] = entry;

if (pos != ndx &&
((pos < 0) ||
buffer_caseless_compare(CONST_BUF_LEN(str->key), CONST_BUF_LEN(a->data[a->sorted[pos]]->key)) > 0)) {
buffer_caseless_compare(CONST_BUF_LEN(entry->key), CONST_BUF_LEN(a->data[a->sorted[pos]]->key)) > 0)) {
pos++;
}

Expand Down

0 comments on commit be121a6

Please sign in to comment.