[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 716c729 4/4: Prefer predecrement when return
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 716c729 4/4: Prefer predecrement when return value not used |
Date: |
Wed, 23 May 2018 12:25:27 -0400 (EDT) |
branch: master
commit 716c7297f3a2c8094971f67829c711bf30122b8c
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Prefer predecrement when return value not used
---
fenv_guard.cpp | 2 +-
input_sequence_entry.cpp | 4 ++--
ledger_pdf_generator_wx.cpp | 2 +-
main_wx_test.cpp | 3 +--
miscellany.cpp | 2 +-
round_to.hpp | 6 +++---
wx_table_generator.cpp | 2 +-
7 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/fenv_guard.cpp b/fenv_guard.cpp
index 83c8908..64c7619 100644
--- a/fenv_guard.cpp
+++ b/fenv_guard.cpp
@@ -35,7 +35,7 @@ fenv_guard::~fenv_guard()
{
try
{
- instance_count_--;
+ --instance_count_;
fenv_validate(e_fenv_indulge_nothing);
}
catch(...)
diff --git a/input_sequence_entry.cpp b/input_sequence_entry.cpp
index 1bfa391..8e15351 100644
--- a/input_sequence_entry.cpp
+++ b/input_sequence_entry.cpp
@@ -797,7 +797,7 @@ void InputSequenceEditor::set_tab_order()
void InputSequenceEditor::remove_row(int row)
{
duration_scalars_.erase(duration_scalars_.begin() + row);
- rows_count_--;
+ --rows_count_;
// remove all controls from the row
for(int i = 0; i < Col_Max; ++i)
@@ -972,7 +972,7 @@ wxString InputSequenceEditor::format_from_text(int row)
{
int num_i = duration_num_field(i).GetValue();
yrs += num_i;
- i--;
+ --i;
}
return wxString::Format
("%s + %d years"
diff --git a/ledger_pdf_generator_wx.cpp b/ledger_pdf_generator_wx.cpp
index cc111b3..bce326d 100644
--- a/ledger_pdf_generator_wx.cpp
+++ b/ledger_pdf_generator_wx.cpp
@@ -1195,7 +1195,7 @@ class numbered_page : public page_with_footer
writer.dc().StartPage();
++this_page_number_;
- extra_pages_--;
+ --extra_pages_;
}
private:
diff --git a/main_wx_test.cpp b/main_wx_test.cpp
index c0b9605..a463c69 100644
--- a/main_wx_test.cpp
+++ b/main_wx_test.cpp
@@ -285,8 +285,7 @@ void remove_arg(int n, int& argc, char* argv[])
// We include argv[argc] in the elements being copied, this guarantees that
// the array remains 0-terminated.
std::memmove(argv + n, argv + n + 1, (argc - n) * sizeof(char*));
-
- argc--;
+ --argc;
}
bool application_test::process_command_line(int& argc, char* argv[])
diff --git a/miscellany.cpp b/miscellany.cpp
index 1978fb1..5f2dce5 100644
--- a/miscellany.cpp
+++ b/miscellany.cpp
@@ -325,7 +325,7 @@ int page_count
auto const free_rows = rows_per_page - groups_per_page *
(rows_per_group + 1);
if(rows_on_last_page <= free_rows)
{
- n_pages--;
+ --n_pages;
}
}
diff --git a/round_to.hpp b/round_to.hpp
index 7ab2096..94b0306 100644
--- a/round_to.hpp
+++ b/round_to.hpp
@@ -177,7 +177,7 @@ RealType round_down(RealType r)
RealType i_part = std::rint(r);
if(r < i_part)
{
- i_part--;
+ --i_part;
}
return i_part;
}
@@ -198,7 +198,7 @@ RealType round_trunc(RealType r)
// get the next integer in the direction of zero.
if(RealType(0) < i_part && f_part < RealType(0))
{
- i_part--;
+ --i_part;
}
else if(RealType(0) < f_part && i_part < RealType(0))
{
@@ -231,7 +231,7 @@ RealType round_near(RealType r)
{
if(f_part < RealType(0))
{
- i_part--;
+ --i_part;
}
else if(RealType(0) < f_part)
{
diff --git a/wx_table_generator.cpp b/wx_table_generator.cpp
index 931a57a..20b89a6 100644
--- a/wx_table_generator.cpp
+++ b/wx_table_generator.cpp
@@ -460,7 +460,7 @@ void wx_table_generator::compute_column_widths()
if(0 < underflow)
{
++i.col_width_;
- underflow--;
+ --underflow;
}
}