Re: [hackers] [libgrapheme] Implement word-segmentation || Laslo Hunhold
On Wed, 8 Jun 2022 17:08:57 +0600 NRK wrote: Dear NRK, > On Mon, Jun 06, 2022 at 10:40:33PM +0200, g...@suckless.org wrote: > > + /* with no breaks we break at the end */ > > + if (off == len) { > > + return len; > > + } else { > > + return off; > > + } > > This is just the same as `return off;` , is it not? yes, indeed, thank you! I've fixed it now[0]. With best regards Laslo [0]:https://git.suckless.org/libgrapheme/commit/5910bc61b6f065cab26682993a76904c37a0f86b.html
[hackers] [libgrapheme] Remove redundant branch || Laslo Hunhold
commit 5910bc61b6f065cab26682993a76904c37a0f86b Author: Laslo Hunhold AuthorDate: Thu Jun 9 11:12:04 2022 +0200 Commit: Laslo Hunhold CommitDate: Thu Jun 9 11:12:04 2022 +0200 Remove redundant branch Thanks NRK for spotting this! Signed-off-by: Laslo Hunhold diff --git a/src/character.c b/src/character.c index ac79327..78da33f 100644 --- a/src/character.c +++ b/src/character.c @@ -192,12 +192,7 @@ grapheme_next_character_break(const uint_least32_t *str, size_t len) } } - /* with no breaks we break at the end */ - if (off == len) { - return len; - } else { - return off; - } + return off; } size_t