[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 033d6b6 2/6: Avoid 'auto' where it is not hel
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 033d6b6 2/6: Avoid 'auto' where it is not helpful |
Date: |
Fri, 7 Sep 2018 19:33:54 -0400 (EDT) |
branch: master
commit 033d6b60f6f387a6f5afc02486340bdadbcb4726
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Avoid 'auto' where it is not helpful
Every variable in the declaration and definition of class paginator is
of type 'int'. Declaring some of them as 'auto' impeded comprehension.
---
report_table.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/report_table.cpp b/report_table.cpp
index 59e5287..bb801f4 100644
--- a/report_table.cpp
+++ b/report_table.cpp
@@ -212,8 +212,8 @@ paginator::paginator(int total_rows, int rows_per_group,
int max_lines_per_page)
// to the preceding page if there's room.
if(1 < page_count_)
{
- auto const rows_on_last_page = total_rows_ - (page_count_ - 1) *
rows_per_page_;
- auto const free_lines = max_lines_per_page_ - lines_per_group_ *
groups_per_page_;
+ int const rows_on_last_page = total_rows_ - (page_count_ - 1) *
rows_per_page_;
+ int const free_lines = max_lines_per_page_ - lines_per_group_ *
groups_per_page_;
LMI_ASSERT(free_lines < rows_per_group_);
if(rows_on_last_page <= free_lines)
{
- [lmi-commits] [lmi] master updated (7376c94 -> f27b89f), Greg Chicares, 2018/09/07
- [lmi-commits] [lmi] master 033d6b6 2/6: Avoid 'auto' where it is not helpful,
Greg Chicares <=
- [lmi-commits] [lmi] master 2207a63 3/6: Refactor: move one line, for a reason soon to be revealed, Greg Chicares, 2018/09/07
- [lmi-commits] [lmi] master ef971ec 1/6: Move test_main function to end where it belongs, Greg Chicares, 2018/09/07
- [lmi-commits] [lmi] master baa8825 5/6: Calculate the exact number of lines on the last page, Greg Chicares, 2018/09/07
- [lmi-commits] [lmi] master a873fa4 4/6: Introduce additional paginator data members, Greg Chicares, 2018/09/07
- [lmi-commits] [lmi] master f27b89f 6/6: Demonstrate pagination with the simplest possible control structure, Greg Chicares, 2018/09/07