summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormrb0nk500 <b0nk@b0nk.xyz>2022-08-04 11:57:28 -0300
committermrb0nk500 <b0nk@b0nk.xyz>2022-08-04 12:04:52 -0300
commit19b8aad81df46615c799d34245e704f1ca7a391a (patch)
treeb4c11aee08ba7bbd4236ed45df24d894c43d9bb2
parent9814032f6c264102b22fcbfe5a51e230fe6037d1 (diff)
misc: Add a little optimization to `remove_trailing_whitespace()`
This also cleans it up a bit.
-rw-r--r--misc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/misc.c b/misc.c
index 462a3bd..12fdd2a 100644
--- a/misc.c
+++ b/misc.c
@@ -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;
}