lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 75c69c6 2/4: Let compiler hoist loop invarian


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 75c69c6 2/4: Let compiler hoist loop invariants
Date: Wed, 23 May 2018 12:25:26 -0400 (EDT)

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

    Let compiler hoist loop invariants
---
 input_sequence_entry.cpp | 3 +--
 main_wx_test.cpp         | 3 +--
 wx_test_paste_census.cpp | 6 ++----
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/input_sequence_entry.cpp b/input_sequence_entry.cpp
index 496f385..2a06fbe 100644
--- a/input_sequence_entry.cpp
+++ b/input_sequence_entry.cpp
@@ -427,9 +427,8 @@ void InputSequenceEditor::sequence(InputSequence const& s)
         }
 
     std::vector<ValueInterval> const& intervals = s.intervals();
-    int const n_intervals = intervals.size();
 
-    for(int i = 0; i < n_intervals; ++i)
+    for(unsigned int i = 0; i < intervals.size(); ++i)
         {
         ValueInterval const& data = intervals[i];
 
diff --git a/main_wx_test.cpp b/main_wx_test.cpp
index 1da9e77..10782f7 100644
--- a/main_wx_test.cpp
+++ b/main_wx_test.cpp
@@ -587,8 +587,7 @@ wxWindow* wx_test_focus_controller_child(MvcController& 
dialog, char const* name
             {
             // We found the notebook, now we can use it to make the page
             // containing the target window current.
-            size_t const n_pages = book->GetPageCount();
-            for(size_t n = 0; n < n_pages; n++)
+            for(size_t n = 0; n < book->GetPageCount(); n++)
                 {
                 if(book->GetPage(n) == maybe_page)
                     {
diff --git a/wx_test_paste_census.cpp b/wx_test_paste_census.cpp
index 17238f7..52b10bb 100644
--- a/wx_test_paste_census.cpp
+++ b/wx_test_paste_census.cpp
@@ -124,8 +124,7 @@ void check_list_columns
 {
     std::set<std::string> remaining(expected.begin(), expected.end());
 
-    unsigned int const n_columns = dvc->GetColumnCount();
-    for(unsigned int n = 0; n < n_columns; ++n)
+    for(unsigned int n = 0; n < dvc->GetColumnCount(); ++n)
         {
         std::string const title = dvc->GetColumn(n)->GetTitle().ToStdString();
         LMI_ASSERT_WITH_MSG
@@ -152,8 +151,7 @@ unsigned int find_model_column_by_title
     ,std::string const& title
     )
 {
-    unsigned int const n_columns = dvc->GetColumnCount();
-    for(unsigned int n = 0; n < n_columns; ++n)
+    for(unsigned int n = 0; n < dvc->GetColumnCount(); ++n)
         {
         wxDataViewColumn const* column = dvc->GetColumn(n);
         if(column->GetTitle().ToStdString() == title)



reply via email to

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