[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_)
- [lmi-commits] [lmi] master updated (6fbb81b -> df0e283), Greg Chicares, 2018/04/27
- [lmi-commits] [lmi] master a6e446f 1/8: Move nested-class forward declaration, Greg Chicares, 2018/04/27
- [lmi-commits] [lmi] master df0e283 8/8: Initialize variable at declaration; simplify logic; clarify commentary,
Greg Chicares <=
- [lmi-commits] [lmi] master f6c8fa6 6/8: Add and use const accessors, Greg Chicares, 2018/04/27
- [lmi-commits] [lmi] master 124dd7b 7/8: Expunge a simulation of a const accessor, Greg Chicares, 2018/04/27
- [lmi-commits] [lmi] master 93ee33f 2/8: Rename a member variable, Greg Chicares, 2018/04/27
- [lmi-commits] [lmi] master c88b192 5/8: Rename member variables, Greg Chicares, 2018/04/27
- [lmi-commits] [lmi] master 1750a86 3/8: Add const accessors, Greg Chicares, 2018/04/27
- [lmi-commits] [lmi] master 30286c5 4/8: Use const accessors, Greg Chicares, 2018/04/27