lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master df0e283 8/8: Initialize variable at declarati


From: Greg Chicares
Subject: [lmi-commits] [lmi] master df0e283 8/8: Initialize variable at declaration; simplify logic; clarify commentary
Date: Fri, 27 Apr 2018 10:52:49 -0400 (EDT)

branch: master
commit df0e2832b719d6f2e95776a24d05c43596b8b03d
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Initialize variable at declaration; simplify logic; clarify commentary
---
 wx_table_generator.cpp | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 0c67124..4ee53bb 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -293,13 +293,10 @@ void wx_table_generator::add_column
 {
     LMI_ASSERT(!column_widths_already_computed_);
 
-    // There is no need to care about the column width for hidden columns.
-    int width;
-    if(header.empty())
-        {
-        width = 0;
-        }
-    else
+    // If a column's header is empty, then it is to be hidden--so its
+    // width isn't used and may as well be initialized to zero.
+    int width = 0;
+    if(!header.empty())
         {
         wxDCFontChanger header_font_setter(dc_);
         if(use_bold_headers_)



reply via email to

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