diff options
author | Thomas Habets <thomas@habets.se> | 2019-11-08 20:21:30 +0000 |
---|---|---|
committer | Michael Dickens <michael.dickens@ettus.com> | 2019-12-04 10:13:22 -0500 |
commit | 1b85d1a7875c8ae3491009225e5134ca5734ca2e (patch) | |
tree | 58d7431551e0914c9ea76ba6952ecedca340747c /gr-fec | |
parent | 25cb814aef1f8b89fd4fcf6e7577e18b0807474b (diff) |
Use C++11 ranged for and ranged insert instead of manual loops
Diffstat (limited to 'gr-fec')
-rw-r--r-- | gr-fec/lib/fec_mtrx_impl.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gr-fec/lib/fec_mtrx_impl.cc b/gr-fec/lib/fec_mtrx_impl.cc index 10ed5f4f3f..302928665f 100644 --- a/gr-fec/lib/fec_mtrx_impl.cc +++ b/gr-fec/lib/fec_mtrx_impl.cc @@ -141,14 +141,13 @@ void write_matrix_to_file(const std::string filename, matrix_sptr M) outputfile << (*std::max_element(colweights.begin(), colweights.end())) << " " << (*std::max_element(rowweights.begin(), rowweights.end())) << std::endl; - std::vector<unsigned int>::iterator itr; - for (itr = colweights.begin(); itr != colweights.end(); itr++) { - outputfile << (*itr) << " "; + for (const auto& weight : colweights) { + outputfile << weight << " "; } outputfile << std::endl; - for (itr = rowweights.begin(); itr != rowweights.end(); itr++) { - outputfile << (*itr) << " "; + for (const auto& weight : rowweights) { + outputfile << weight << " "; } outputfile << std::endl; |