gbranden pushed a commit to branch master
in repository groff.

commit fbb029310d2a0d1d1598c55e4cbf9cab3f300f4d
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Apr 20 18:19:17 2025 -0500

    [troff]: Trivially refactor for readability.
    
    * src/roff/troff/node.cpp (env_sentence_space_width): Trivially refactor
      for readability.  Introduce local variable to store return value of
      member function that is called invariantly.
---
 ChangeLog               | 6 ++++++
 src/roff/troff/node.cpp | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c6edd1df9..08369523f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-04-20  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/node.cpp (env_sentence_space_width): Trivially
+       refactor for readability.  Introduce local variable to store
+       return value of member function that is called invariantly.
+
 2025-04-20  G. Branden Robinson <[email protected]>
 
        [troff]: Slightly refactor.  Boolify and rename
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 846f362e9..2d7a4820a 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -7002,11 +7002,11 @@ hunits env_sentence_space_width(environment *env)
 {
   int fn = env_resolve_font(env);
   font_size fs = env->get_font_size();
-  // TODO: use temp var for env->get_sentence_space_size()
+  units sss = env->get_sentence_space_size();
   if (!is_valid_font_mounting_position(fn))
-    return scale(fs.to_units() / 3, env->get_sentence_space_size(), 12);
+    return scale(fs.to_units() / 3, sss, 12);
   else
-    return font_table[fn]->get_space_width(fs, env->get_sentence_space_size());
+    return font_table[fn]->get_space_width(fs, sss);
 }
 
 hunits env_half_narrow_space_width(environment *env)

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to