Skip to content
Myr

Remove unused nref accumulator in block_bind_library

Before adoption: this commit came in with the history the project adopted, so no landing records it.

detected as a warning compiling jq with clang.

authored by Emanuele Torre · committed by Nico Williams · parent 0714939 · Browse files · 1 file+1 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−2 removed

  • other:+1 added−2 removed

1 file+1 added−2 removed

modified:src/compile.c+1 added-2 removed
370 unmodified lines
371}372373block block_bind_library(block binder, block body, int bindflags, const char *libname) {374 bindflags |= OP_HAS_BINDING;375 int nrefs = 0;375 int matchlen = (libname == NULL) ? 0 : strlen(libname);376 char *matchname = jv_mem_alloc(matchlen+2+1);377 matchname[0] = '\0';378 if (libname != NULL && libname[0] != '\0') {
14 unmodified lines
393 bindflags2 = OP_HAS_VARIABLE | OP_HAS_BINDING;394395 // This mutation is ugly, even if we undo it396 curr->symbol = tname;398 nrefs += block_bind_subblock(inst_block(curr), body, bindflags2, 0);397 block_bind_subblock(inst_block(curr), body, bindflags2, 0);398 curr->symbol = cname;399 free(tname);400 }401 free(matchname);
999 unmodified lines