Skip to content

Commit dc4b4a6

Browse files
committed
submodule--helper: do not call utf8_fprintf() unnecessarily
The helper function utf8_fprintf(fp, ...) has exactly the same effect to the output stream fp as fprintf(fp, ...) does, and the only difference is that its return value counts in display columns consumed (assuming that the payload is encoded in UTF-8), as opposed to number of bytes. There is no reason to call it unless the caller cares about its return value. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 840ed14 commit dc4b4a6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

builtin/submodule--helper.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#include "quote.h"
55
#include "pathspec.h"
66
#include "dir.h"
7-
#include "utf8.h"
87
#include "submodule.h"
98
#include "submodule-config.h"
109
#include "string-list.h"
@@ -298,7 +297,7 @@ static int module_list(int argc, const char **argv, const char *prefix)
298297
else
299298
printf("%06o %s %d\t", ce->ce_mode, sha1_to_hex(ce->sha1), ce_stage(ce));
300299

301-
utf8_fprintf(stdout, "%s\n", ce->name);
300+
fprintf(stdout, "%s\n", ce->name);
302301
}
303302
return 0;
304303
}
@@ -887,7 +886,7 @@ static int update_clone(int argc, const char **argv, const char *prefix)
887886
return 1;
888887

889888
for_each_string_list_item(item, &suc.projectlines)
890-
utf8_fprintf(stdout, "%s", item->string);
889+
fprintf(stdout, "%s", item->string);
891890

892891
return 0;
893892
}

0 commit comments

Comments
 (0)