Skip to content

utf8.c: strbuf'ify strbuf_add_wrapped_text()

René Scharfe git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4utf8.c: remove print_wrapped_text()builtin-shortlog.c utf8.c utf8.h+14 -90 replies
2/4utf8.c: remove print_spaces()utf8.c+6 -90 replies
3/4utf8.c: remove strbuf_write()utf8.c+5 -130 replies
4/4utf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text()utf8.c+17 -62 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] utf8.c: strbuf'ify strbuf_add_wrapped_text()

The strbuf parameter of strbuf_add_wrapped_text() in utf8.c is optional; if it's missing, results are directly written to stdout. By removing this flexibility and converting it to only call "pure" strbuf functions, this series cleans up the code a bit and enables an optimization, which is added in the last patch:

[PATCH 1/4] utf8.c: remove print_wrapped_text()
[PATCH 2/4] utf8.c: remove print_spaces()
[PATCH 3/4] utf8.c: remove strbuf_write()

[PATCH 4/4] utf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text()

 builtin-shortlog.c |   17 ++++++++++++--
 utf8.c             |   61 +++++++++++++++++++++++----------------------------
 utf8.h             |    1 -
 3 files changed, 42 insertions(+), 37 deletions(-)