]> git.99rst.org Git - git.git/commit
strbuf: use skip_prefix() in strbuf_addftime()
authorRené Scharfe <redacted>
Sun, 16 Jul 2023 08:52:33 +0000 (10:52 +0200)
committerJunio C Hamano <redacted>
Mon, 17 Jul 2023 16:24:49 +0000 (09:24 -0700)
commit945c72250afcf50a0f5394151b76d5da28fa6f94
treec786b61430c16339fd61ba978124ac94df7ff28e
parentda269af9207e38e820daad8aa993caa7d2fad76c
strbuf: use skip_prefix() in strbuf_addftime()

Use the now common skip_prefix() cascade instead of a case statement to
parse the strftime(3) format in strbuf_addftime().  skip_prefix() parses
the "fmt" pointer and advances it appropriately, making additional
pointer arithmetic unnecessary.  The resulting code is more compact and
consistent with most other strbuf_expand_step() loops.

Signed-off-by: René Scharfe <redacted>
Signed-off-by: Junio C Hamano <redacted>
strbuf.c
git clone https://git.99rst.org/PROJECT