From: Ben Pfaff Date: Sun, 5 Mar 2023 19:04:29 +0000 (-0800) Subject: case-map: Optimize case_map_create_output_translator() for no-op case. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=386de605e587854f3640b3998b5cc621f263272a;p=pspp case-map: Optimize case_map_create_output_translator() for no-op case. --- 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. */