gbranden pushed a commit to branch master
in repository groff.
commit 05036f82e9b09e026bbd8fa0504211a32a85fb62
Author: G. Branden Robinson <[email protected]>
AuthorDate: Thu Sep 18 12:57:11 2025 -0500
src/roff/troff/node.cpp: Refactor.
* src/roff/troff/node.cpp (dbreak_node::asciify): Replace call of
`asciify_reverse_node_list()` with a more idiomatic recursive call of
the `none` contained node's `asciify()` member function.
(asciify_reverse_node_list): Drop function with no remaining call
sites.
---
ChangeLog | 9 +++++++++
src/roff/troff/node.cpp | 12 +-----------
2 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9fbf64ec4..0831965da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2025-09-18 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/node.cpp: Refactor.
+ (dbreak_node::asciify): Replace call of
+ `asciify_reverse_node_list()` with a more idiomatic recursive
+ call of the `none` contained node's `asciify()` member function.
+ (asciify_reverse_node_list): Drop function with no remaining
+ call sites.
+
2025-09-18 G. Branden Robinson <[email protected]>
* tmac/an.tmac:
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 4c2fde9d2..3a4430ea3 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -3916,22 +3916,12 @@ void kern_pair_node::asciify(macro *m)
}
}
-static void asciify_reverse_node_list(macro *m, node *n)
-{
- assert(m != 0 /* nullptr */);
- assert(n != 0 /* nullptr */);
- if ((0 /* nullptr */ == m) || (0 /* nullptr */ == n))
- return;
- asciify_reverse_node_list(m, n->next);
- n->asciify(m);
-}
-
void dbreak_node::asciify(macro *m)
{
assert(m != 0 /* nullptr */);
if (!is_output_supressed) {
if (m != 0 /* nullptr */)
- asciify_reverse_node_list(m, none);
+ none->asciify(m);
none = 0 /* nullptr */;
}
}
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit