Improve memory efficiency via plain ints for length

This commit is contained in:
2022-11-29 20:57:50 -05:00
parent d965ca142d
commit 13704fae2c
16 changed files with 183 additions and 84 deletions

View File

@@ -134,20 +134,19 @@ static void test_list_append_list() {
}
static void test_list_nth_nil_0() {
response = ucl_list_nth(state, ucl_nil_create(state), 0);
response = ucl_list_nth(ucl_nil_create(state), 0);
TEST_ASSERT_OBJ_ERROR(response);
}
static void test_list_nth_nil_1() {
response = ucl_list_nth(state, ucl_nil_create(state), 1);
response = ucl_list_nth(ucl_nil_create(state), 1);
TEST_ASSERT_OBJ_ERROR(response);
}
static void test_list_nth_list_0() {
response = ucl_list_nth(
state,
ucl_tuple_create(state,
ucl_t_create(state),
ucl_string_create(state, "foo")),
@@ -158,7 +157,6 @@ static void test_list_nth_list_0() {
static void test_list_nth_list_1() {
response = ucl_list_nth(
state,
ucl_tuple_create(state,
ucl_t_create(state),
ucl_string_create(state, "foo")),
@@ -168,20 +166,19 @@ static void test_list_nth_list_1() {
}
static void test_list_nth_t_0() {
response = ucl_list_nth(state, ucl_t_create(state), 1);
response = ucl_list_nth(ucl_t_create(state), 1);
TEST_ASSERT_OBJ_ERROR(response);
}
static void test_list_nth_bounds_0() {
response = ucl_list_nth(state, ucl_nil_create(state), 0);
response = ucl_list_nth(ucl_nil_create(state), 0);
TEST_ASSERT_OBJ_ERROR(response);
}
static void test_list_nth_bounds_1() {
response = ucl_list_nth(
state,
ucl_cell_create(state,
ucl_nil_create(state),
NULL),
@@ -192,7 +189,6 @@ static void test_list_nth_bounds_1() {
static void test_list_nth_bounds_2() {
response = ucl_list_nth(
state,
ucl_tuple_create(state,
ucl_nil_create(state),
ucl_nil_create(state)),