gbranden pushed a commit to branch master
in repository groff.
commit 5dfc6d6fe240d4b6ef955a3ba165b9a88f7d2c89
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Jun 19 04:12:48 2026 -0500
src/libs/libgroff/string.cpp: Add comments.
Annotate future direction.
---
src/libs/libgroff/string.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/libs/libgroff/string.cpp b/src/libs/libgroff/string.cpp
index c891e4a84..56c0d9497 100644
--- a/src/libs/libgroff/string.cpp
+++ b/src/libs/libgroff/string.cpp
@@ -469,8 +469,13 @@ void string::json_dump() const
free(const_cast<char *>(repr));
}
+// TODO: This function has 1 call site, in tbl/main.cpp:process_data().
+// Consider either open-coding this logic there, or generalizing this
+// function to a `filter()` that takes a character parameter.
void string::remove_spaces()
{
+ // This method is arguably inefficient, but see above regarding the
+ // one call site.
size_t l = len - 1;
while ((l < len) && (ptr[l] == ' '))
l--;
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit