OSDN Git Service

submodule--helper: do not call utf8_fprintf() unnecessarily
authorJunio C Hamano <gitster@pobox.com>
Wed, 28 Jun 2017 20:38:48 +0000 (13:38 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Jun 2017 21:27:10 +0000 (14:27 -0700)
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>
builtin/submodule--helper.c

index dbe5699..704df87 100644 (file)
@@ -4,7 +4,6 @@
 #include "quote.h"
 #include "pathspec.h"
 #include "dir.h"
-#include "utf8.h"
 #include "submodule.h"
 #include "submodule-config.h"
 #include "string-list.h"
@@ -298,7 +297,7 @@ static int module_list(int argc, const char **argv, const char *prefix)
                else
                        printf("%06o %s %d\t", ce->ce_mode, sha1_to_hex(ce->sha1), ce_stage(ce));
 
-               utf8_fprintf(stdout, "%s\n", ce->name);
+               fprintf(stdout, "%s\n", ce->name);
        }
        return 0;
 }
@@ -887,7 +886,7 @@ static int update_clone(int argc, const char **argv, const char *prefix)
                return 1;
 
        for_each_string_list_item(item, &suc.projectlines)
-               utf8_fprintf(stdout, "%s", item->string);
+               fprintf(stdout, "%s", item->string);
 
        return 0;
 }