From 386de605e587854f3640b3998b5cc621f263272a Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 5 Mar 2023 11:04:29 -0800 Subject: [PATCH] case-map: Optimize case_map_create_output_translator() for no-op case. --- src/data/case-map.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/data/case-map.c b/src/data/case-map.c index 214abaf844..c80a6679e3 100644 --- a/src/data/case-map.c +++ b/src/data/case-map.c @@ -154,11 +154,13 @@ struct casewriter * case_map_create_output_translator (struct case_map *map, struct casewriter *subwriter) { - return casewriter_create_translator (subwriter, - case_map_get_proto (map), - translate_case, - destroy_case_map, - map); + if (!map) + return casewriter_rename (subwriter); + return casewriter_create_translator (subwriter, + case_map_get_proto (map), + translate_case, + destroy_case_map, + map); } /* Casereader/casewriter translation callback. */ -- 2.30.2