From e44c2372e1b70f79e83e8ecbb10d6f99f679a872 Mon Sep 17 00:00:00 2001 From: pantor Date: Fri, 23 Nov 2018 18:03:51 +0100 Subject: [PATCH] code cleaning --- src/inja.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/inja.hpp b/src/inja.hpp index 059e473..a278a63 100644 --- a/src/inja.hpp +++ b/src/inja.hpp @@ -74,8 +74,8 @@ public: class Match: public std::match_results { - size_t offset_ = 0; - unsigned int group_offset_ = 0; + size_t offset_ {0}; + unsigned int group_offset_ {0}; Regex regex_; public: @@ -182,7 +182,7 @@ inline MatchType search(const std::string& input, const std::map& r inline MatchClosed search_closed_on_level(const std::string& input, const Regex& regex_statement, const Regex& regex_level_up, const Regex& regex_level_down, const Regex& regex_search, Match open_match) { - int level = 0; + int level {0}; size_t current_position = open_match.end_position(); Match match_delimiter = search(input, regex_statement, current_position); while (match_delimiter.found()) { @@ -563,7 +563,7 @@ public: } std::string render(Template temp, const json& data) { - std::string result = ""; + std::string result {""}; for (const auto& element: temp.parsed_template().children) { switch (element->type) { case Parsed::Type::String: { @@ -749,7 +749,7 @@ public: Parsed::ElementExpression parse_expression(const std::string& input) { const MatchType match_callback = match(input, regex_map_callbacks); if (!match_callback.type().first.empty()) { - std::vector args = {}; + std::vector args {}; for (unsigned int i = 1; i < match_callback.size(); i++) { // str(0) is whole group args.push_back( parse_expression(match_callback.str(i)) ); } @@ -972,8 +972,8 @@ class Environment { const std::string input_path; const std::string output_path; - Parser parser = Parser(); - Renderer renderer = Renderer(); + Parser parser; + Renderer renderer; public: Environment(): Environment("./") { }