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 <gitster@pobox.com>
Junio C Hamano committed
Jun 28, 2017 at 13:38 UTC
dc4b4a61baac86bb75b0bdffb9ca45e90c4e194d
1 file changed
+2
-3
builtin/submodule--helper.c
+2
-3
@@ -4,7 +4,6 @@
4
#include "quote.h"
5
#include "pathspec.h"
6
#include "dir.h"
7
-#include "utf8.h"
7
#include "submodule.h"
8
#include "submodule-config.h"
9
#include "string-list.h"
@@ -298,7 +297,7 @@ static int module_list(int argc, const char **argv, const char *prefix)
297
else
298
printf("%06o %s %d\t", ce->ce_mode, sha1_to_hex(ce->sha1), ce_stage(ce));
299
301
- utf8_fprintf(stdout, "%s\n", ce->name);
300
+ fprintf(stdout, "%s\n", ce->name);
301
}
302
return 0;
303
}
@@ -887,7 +886,7 @@ static int update_clone(int argc, const char **argv, const char *prefix)
886
return 1;
887
888
for_each_string_list_item(item, &suc.projectlines)
890
- utf8_fprintf(stdout, "%s", item->string);
889
+ fprintf(stdout, "%s", item->string);
890
891
return 0;
892
}