Make isc_ht_init() and isc_ht_iter_create() return void
Previously, the function(s) in the commit subject could fail for various reasons - mostly allocation failures, or other functions returning different return code than ISC_R_SUCCESS. Now, the aforementioned function(s) cannot ever fail and they would always return ISC_R_SUCCESS. Change the function(s) to return void and remove the extra checks in the code that uses them.
This commit is contained in:
@@ -61,8 +61,7 @@ test_ht_full(int bits, uintptr_t count) {
|
||||
isc_result_t result;
|
||||
uintptr_t i;
|
||||
|
||||
result = isc_ht_init(&ht, test_mctx, bits);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_ht_init(&ht, test_mctx, bits);
|
||||
assert_non_null(ht);
|
||||
|
||||
for (i = 1; i < count; i++) {
|
||||
@@ -207,8 +206,7 @@ test_ht_iterator(void) {
|
||||
unsigned char key[16];
|
||||
size_t tksize;
|
||||
|
||||
result = isc_ht_init(&ht, test_mctx, 16);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_ht_init(&ht, test_mctx, 16);
|
||||
assert_non_null(ht);
|
||||
for (i = 1; i <= count; i++) {
|
||||
/*
|
||||
@@ -222,8 +220,7 @@ test_ht_iterator(void) {
|
||||
}
|
||||
|
||||
walked = 0;
|
||||
result = isc_ht_iter_create(ht, &iter);
|
||||
assert_int_equal(result, ISC_R_SUCCESS);
|
||||
isc_ht_iter_create(ht, &iter);
|
||||
|
||||
for (result = isc_ht_iter_first(iter); result == ISC_R_SUCCESS;
|
||||
result = isc_ht_iter_next(iter))
|
||||
|
||||
Reference in New Issue
Block a user