From 0fa0def11270d9403f6fc83a946af31629d7c6ac Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Mon, 18 Sep 2017 15:00:52 +0200 Subject: [PATCH 1/2] Use range-based for --- include/chaiscript/dispatchkit/dispatchkit.hpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/include/chaiscript/dispatchkit/dispatchkit.hpp b/include/chaiscript/dispatchkit/dispatchkit.hpp index d8bfb25b..2e71e543 100644 --- a/include/chaiscript/dispatchkit/dispatchkit.hpp +++ b/include/chaiscript/dispatchkit/dispatchkit.hpp @@ -1143,24 +1143,17 @@ namespace chaiscript { std::cout << "Registered Types: \n"; std::vector > types = get_types(); - for (std::vector >::const_iterator itr = types.begin(); - itr != types.end(); - ++itr) + for (auto const &type: get_types()) { - std::cout << itr->first << ": "; - std::cout << itr->second.bare_name(); - std::cout << '\n'; + std::cout << type.first << ": " << type.second.bare_name() << '\n'; } std::cout << '\n'; - std::vector > funcs = get_functions(); std::cout << "Functions: \n"; - for (std::vector >::const_iterator itr = funcs.begin(); - itr != funcs.end(); - ++itr) + for (auto const &func: get_functions()) { - dump_function(*itr); + dump_function(func); } std::cout << '\n'; } From 3e521d29522016e75960ba7da3af71c652c0675b Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Mon, 18 Sep 2017 17:00:04 +0200 Subject: [PATCH 2/2] Delete now useless local copy --- include/chaiscript/dispatchkit/dispatchkit.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/include/chaiscript/dispatchkit/dispatchkit.hpp b/include/chaiscript/dispatchkit/dispatchkit.hpp index 2e71e543..ae729819 100644 --- a/include/chaiscript/dispatchkit/dispatchkit.hpp +++ b/include/chaiscript/dispatchkit/dispatchkit.hpp @@ -1142,7 +1142,6 @@ namespace chaiscript void dump_system() const { std::cout << "Registered Types: \n"; - std::vector > types = get_types(); for (auto const &type: get_types()) { std::cout << type.first << ": " << type.second.bare_name() << '\n';