[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 795707f 1/6: Prefer braced-init-list to push_
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 795707f 1/6: Prefer braced-init-list to push_back |
Date: |
Sat, 28 Jan 2017 04:52:22 +0000 (UTC) |
branch: master
commit 795707f5835539c3ea9b2e81b232ab8e4faba8ad
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Prefer braced-init-list to push_back
---
input_seq_test.cpp | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/input_seq_test.cpp b/input_seq_test.cpp
index ffe1535..eb8e5a5 100644
--- a/input_seq_test.cpp
+++ b/input_seq_test.cpp
@@ -302,13 +302,7 @@ int test_main(int, char*[])
char const* c[n] = {"a", "a", "ccc", "ccc", "b", "b", "b", "b", "b"};
double const d[n] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
std::string const e("a[0, 2); ccc [2, 4);b[4, 6);");
- std::vector<std::string> k;
- k.push_back("not_used");
- k.push_back("a");
- k.push_back("b");
- k.push_back("c");
- k.push_back("cc");
- k.push_back("ccc");
+ std::vector<std::string> const k{"not_used", "a", "b", "c", "cc", "ccc"};
check(__FILE__, __LINE__, d, n, e, "", k, c);
}
@@ -318,8 +312,7 @@ int test_main(int, char*[])
char const* c[n] = {"", "", "keyword_00", "keyword_00", "", "", "", "",
""};
double const d[n] = {1, 1, 0, 0, 5, 5, 7, 7, 7};
std::string const e("1 [0, 2); keyword_00 [2, 4); 5 [4, 6); 7");
- std::vector<std::string> k;
- k.push_back("keyword_00");
+ std::vector<std::string> const k{"keyword_00"};
check(__FILE__, __LINE__, d, n, e, "", k, c);
}
@@ -330,10 +323,7 @@ int test_main(int, char*[])
char const* c[n] = {"b", "b", "x", "a", "x", "x", "a", "x", "x", "x"};
double const d[n] = { 0, 0, 0, 0, 5, 5, 0, 7, 7, 7};
std::string const e("b [0, 2); a [3, 4); 5 [4, 6); a; 7");
- std::vector<std::string> k;
- k.push_back("a");
- k.push_back("b");
- k.push_back("x");
+ std::vector<std::string> const k{"a", "b", "x"};
std::string w("x");
check(__FILE__, __LINE__, d, n, e, "", k, c, w);
}
- [lmi-commits] [lmi] master updated (81185a8 -> 11eedff), Greg Chicares, 2017/01/27
- [lmi-commits] [lmi] master bd7b696 5/6: Improve concinnity, Greg Chicares, 2017/01/27
- [lmi-commits] [lmi] master 11eedff 6/6: Improve concinnity, Greg Chicares, 2017/01/27
- [lmi-commits] [lmi] master 795707f 1/6: Prefer braced-init-list to push_back,
Greg Chicares <=
- [lmi-commits] [lmi] master 4209d20 2/6: Further strengthen input-sequence unit test, Greg Chicares, 2017/01/27
- [lmi-commits] [lmi] master 6805835 4/6: Shorten long lines, Greg Chicares, 2017/01/27
- [lmi-commits] [lmi] master 6921ed7 3/6: Belay array decay, Greg Chicares, 2017/01/27