Skip to content

Commit f21d695

Browse files
committed
Use tr31_opt_block_find() instead of duplicate for-loop.
1 parent 151fd58 commit f21d695

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/tr31.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,14 +1391,7 @@ int tr31_opt_block_add_CT(
13911391
}
13921392

13931393
// find existing optional block CT
1394-
opt_block_ct = NULL;
1395-
for (size_t i = 0; i < ctx->opt_blocks_count; ++i) {
1396-
if (ctx->opt_blocks[i].id == TR31_OPT_BLOCK_CT) {
1397-
opt_block_ct = &ctx->opt_blocks[i];
1398-
break;
1399-
}
1400-
}
1401-
1394+
opt_block_ct = tr31_opt_block_find(ctx, TR31_OPT_BLOCK_CT);
14021395
if (opt_block_ct) {
14031396
struct tr31_opt_ctx_t old = *opt_block_ct;
14041397
const char* old_data = old.data;

0 commit comments

Comments
 (0)