diff options
author | mrb0nk500 <b0nk@b0nk.xyz> | 2022-08-04 11:57:28 -0300 |
---|---|---|
committer | mrb0nk500 <b0nk@b0nk.xyz> | 2022-08-04 12:04:52 -0300 |
commit | 19b8aad81df46615c799d34245e704f1ca7a391a (patch) | |
tree | b4c11aee08ba7bbd4236ed45df24d894c43d9bb2 | |
parent | 9814032f6c264102b22fcbfe5a51e230fe6037d1 (diff) |
misc: Add a little optimization to `remove_trailing_whitespace()`
This also cleans it up a bit.
-rw-r--r-- | misc.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -95,8 +95,7 @@ char *remove_trailing_whitespace(char *str) { for (char *tmp = s; !is_empty(tmp); s = tmp, tmp = find_delm(tmp, whitespace, 1)); - s = find_delm(s, whitespace, 0); - *s = '\0'; + *find_delm(s, whitespace, 0) = '\0'; return str; } |