groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 04/20: src/preproc/tbl/table.cpp: Trivially refactor.


From: G. Branden Robinson
Subject: [groff] 04/20: src/preproc/tbl/table.cpp: Trivially refactor.
Date: Fri, 3 Feb 2023 16:47:52 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 926891cbe5d3a6baadbc8fd35a08550115999947
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Thu Feb 2 11:23:10 2023 -0600

    src/preproc/tbl/table.cpp: Trivially refactor.
    
    * src/preproc/tbl/table.cpp (table::compute_total_separation): Trivially
      refactor; rename loop indices so it's obvious which dimension of a
      matrix they're referring to.
---
 ChangeLog                 |  6 ++++++
 src/preproc/tbl/table.cpp | 11 +++++------
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 4492b3402..7b3034b02 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-02-02  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       * src/preproc/tbl/table.cpp (table::compute_total_separation):
+       Trivially refactor; rename loop indices so it's obvious which
+       dimension of a matrix they're referring to.
+
 2023-02-02  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        * src/preproc/tbl/table.cpp (table::determine_row_type)
diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp
index 648e5fbe6..126f1c2d2 100644
--- a/src/preproc/tbl/table.cpp
+++ b/src/preproc/tbl/table.cpp
@@ -2232,17 +2232,16 @@ void table::compute_total_separation()
   if (flags & (ALLBOX | BOX | DOUBLEBOX))
     left_separation = right_separation = 1;
   else {
-    for (int i = 0; i < nrows; i++) {
-      if (vline[i][0] > 0)
+    for (int r = 0; r < nrows; r++) {
+      if (vline[r][0] > 0)
        left_separation = 1;
-      if (vline[i][ncolumns] > 0)
+      if (vline[r][ncolumns] > 0)
        right_separation = 1;
     }
   }
   total_separation = left_separation + right_separation;
-  int i;
-  for (i = 0; i < ncolumns - 1; i++)
-    total_separation += column_separation[i];
+  for (int c = 0; c < ncolumns - 1; c++)
+    total_separation += column_separation[c];
 }
 
 void table::compute_separation_factor()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]