Welcome! Log In Create A New Profile

Advanced

[njs] Better name for append elements count in njs_array_expand().

Valentin Bartenev
May 08, 2019 06:22PM
details: https://hg.nginx.org/njs/rev/4ed09499a560
branches:
changeset: 958:4ed09499a560
user: Valentin Bartenev <vbart@nginx.com>
date: Wed May 08 19:09:10 2019 +0300
description:
Better name for append elements count in njs_array_expand().

No functional changes.

diffstat:

njs/njs_array.c | 4 ++--
njs/njs_array.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r ff76f83fc49a -r 4ed09499a560 njs/njs_array.c
--- a/njs/njs_array.c Tue May 07 20:41:07 2019 +0300
+++ b/njs/njs_array.c Wed May 08 19:09:10 2019 +0300
@@ -212,12 +212,12 @@ njs_array_string_add(njs_vm_t *vm, njs_a

njs_ret_t
njs_array_expand(njs_vm_t *vm, njs_array_t *array, uint32_t prepend,
- uint32_t new_size)
+ uint32_t append)
{
uint64_t size;
njs_value_t *start, *old;

- size = (uint64_t) new_size + array->length;
+ size = (uint64_t) append + array->length;

if (nxt_fast_path(size <= array->size && prepend == 0)) {
return NXT_OK;
diff -r ff76f83fc49a -r 4ed09499a560 njs/njs_array.h
--- a/njs/njs_array.h Tue May 07 20:41:07 2019 +0300
+++ b/njs/njs_array.h Wed May 08 19:09:10 2019 +0300
@@ -20,7 +20,7 @@ njs_ret_t njs_array_add(njs_vm_t *vm, nj
njs_ret_t njs_array_string_add(njs_vm_t *vm, njs_array_t *array,
const u_char *start, size_t size, size_t length);
njs_ret_t njs_array_expand(njs_vm_t *vm, njs_array_t *array, uint32_t prepend,
- uint32_t size);
+ uint32_t append);
njs_ret_t njs_array_constructor(njs_vm_t *vm, njs_value_t *args,
nxt_uint_t nargs, njs_index_t unused);

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Better name for append elements count in njs_array_expand().

Valentin Bartenev 60 May 08, 2019 06:22PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 90
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready