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>
This commit is contained in:
Junio C Hamano 2017-06-28 13:38:48 -07:00
Родитель 840ed14198
Коммит dc4b4a61ba
1 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -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;
}