]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
minor cleanups
authorEvan Hunt <each@isc.org>
Wed, 27 Sep 2023 20:01:43 +0000 (13:01 -0700)
committerEvan Hunt <each@isc.org>
Wed, 27 Sep 2023 20:05:05 +0000 (13:05 -0700)
- removed some commented-out code
- cleaned up uses of pval and ival that were not needed

tests/bench/qp-dump.c
tests/bench/qpmulti.c

index 855bbbc3dcf92c16dfc1a24390e14fbd4bd16cdb..9b8865b92776ea7028d8f17b4a084694fcbf436f 100644 (file)
@@ -57,8 +57,7 @@ smallname_offsets(void *pval, uint32_t ival) {
 }
 
 static void
-smallname_from_name(/* isc_mem_t *mctx, */ const dns_name_t *name, void **valp,
-                   uint32_t *ctxp) {
+smallname_from_name(const dns_name_t *name, void **valp, uint32_t *ctxp) {
        size_t size = sizeof(isc_refcount_t) + name->length + name->labels;
        *valp = isc_mem_get(mctx, size);
        *ctxp = name->labels << 8 | name->length;
@@ -68,7 +67,7 @@ smallname_from_name(/* isc_mem_t *mctx, */ const dns_name_t *name, void **valp,
 }
 
 static void
-smallname_free(/* isc_mem_t *mctx, */ void *pval, uint32_t ival) {
+smallname_free(void *pval, uint32_t ival) {
        size_t size = sizeof(isc_refcount_t);
        size += smallname_length(pval, ival) + smallname_labels(pval, ival);
        isc_mem_put(mctx, pval, size);
index feb30a0f00f2313bb8d389ec81df421cc9c3d416..df0b81adbbd65c2dd1195448a267835a1320d813 100644 (file)
@@ -125,8 +125,6 @@ random_byte(void) {
 
 static void
 init_items(isc_mem_t *mctx) {
-       void *pval = NULL;
-       uint32_t ival = ~0U;
        dns_qp_t *qp = NULL;
        uint64_t start;
 
@@ -143,8 +141,8 @@ init_items(isc_mem_t *mctx) {
                                item[i].key[off] = random_byte();
                        }
                        item[i].key[len] = SHIFT_NOBYTE;
-               } while (dns_qp_getkey(qp, item[i].key, item[i].len, &pval,
-                                      &ival) == ISC_R_SUCCESS);
+               } while (dns_qp_getkey(qp, item[i].key, item[i].len, NULL,
+                                      NULL) == ISC_R_SUCCESS);
                INSIST(dns_qp_insert(qp, &item[i], i) == ISC_R_SUCCESS);
        }
        dns_qp_destroy(&qp);
@@ -236,8 +234,6 @@ static void
 read_zipf(void *varg) {
        struct thread_args *args = varg;
        isc_nanosecs_t start;
-       void *pval = NULL;
-       uint32_t ival;
 
        /* outside time because it is v slow */
        uint32_t r[args->tx_per_loop][args->ops_per_tx];
@@ -255,7 +251,7 @@ read_zipf(void *varg) {
                for (uint32_t op = 0; op < args->ops_per_tx; op++) {
                        uint32_t i = r[tx][op];
                        isc_result_t result = dns_qp_getkey(
-                               &qp, item[i].key, item[i].len, &pval, &ival);
+                               &qp, item[i].key, item[i].len, NULL, NULL);
                        if (result == ISC_R_SUCCESS) {
                                args->present++;
                        } else {
@@ -274,8 +270,6 @@ static void
 read_transactions(void *varg) {
        struct thread_args *args = varg;
        isc_nanosecs_t start = isc_time_monotonic();
-       void *pval = NULL;
-       uint32_t ival;
 
        for (uint32_t tx = 0; tx < args->tx_per_loop; tx++) {
                args->transactions++;
@@ -284,7 +278,7 @@ read_transactions(void *varg) {
                for (uint32_t op = 0; op < args->ops_per_tx; op++) {
                        uint32_t i = isc_random_uniform(args->max_item);
                        isc_result_t result = dns_qp_getkey(
-                               &qp, item[i].key, item[i].len, &pval, &ival);
+                               &qp, item[i].key, item[i].len, NULL, NULL);
                        if (result == ISC_R_SUCCESS) {
                                args->present++;
                        } else {