diff --git a/src/render_context.cpp b/src/render_context.cpp index 999113a..9a0d4cd 100644 --- a/src/render_context.cpp +++ b/src/render_context.cpp @@ -56,5 +56,5 @@ std::string render_context::render(const template_type& templt) { } std::string render_context::render_partial(const std::string& partial_name) { - return (partials.count(partial_name)) ? render(partials.at(partial_name)) :""; + return partials.count(partial_name) ? render(partials.at(partial_name)) : ""; } diff --git a/src/template_type.cpp b/src/template_type.cpp index 1b4000e..a7310da 100644 --- a/src/template_type.cpp +++ b/src/template_type.cpp @@ -26,7 +26,7 @@ void template_type::tokenize(const std::string& tmp) { for (unsigned long cur_pos = 0; cur_pos < tmp.size();) { auto open_pos = tmp.find(open, cur_pos); auto close_pos = tmp.find( - close, (open_pos == npos) ? open_pos : (open_pos + 1)); + close, open_pos == npos ? open_pos : open_pos + 1); if (close_pos != npos && open_pos != npos) { if (*(beg + open_pos + open.size()) == '{' && @@ -66,7 +66,7 @@ void template_type::strip_whitespace() { if ((*it).eol()) { if (has_tag && !non_space) for (auto cur = line_begin; it != cur - 1; - cur = (*cur).ws_only() ? tokens.erase(cur) : ++cur) + cur = (*cur).ws_only() ? tokens.erase(cur) : cur + 1) it = (*cur).eol() ? cur - 1 : it; non_space = has_tag = false;