Skip to content

Commit

Permalink
🔨 cleanup
Browse files Browse the repository at this point in the history
Fixed some warning in Clion.
  • Loading branch information
nlohmann committed Aug 22, 2017
1 parent 9fd031b commit 0b5e8f8
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1665,7 +1665,7 @@ class lexer
}

explicit lexer(detail::input_adapter_t adapter)
: ia(adapter), decimal_point_char(get_decimal_point()) {}
: ia(std::move(adapter)), decimal_point_char(get_decimal_point()) {}

// delete because of pointer members
lexer(const lexer&) = delete;
Expand Down Expand Up @@ -4439,7 +4439,7 @@ class binary_reader
@param[in] adapter input adapter to read from
*/
explicit binary_reader(input_adapter_t adapter) : ia(adapter)
explicit binary_reader(input_adapter_t adapter) : ia(std::move(adapter))
{
assert(ia);
}
Expand Down Expand Up @@ -6035,7 +6035,7 @@ class serializer
@param[in] ichar indentation character to use
*/
serializer(output_adapter_t<char> s, const char ichar)
: o(s), loc(std::localeconv()),
: o(std::move(s)), loc(std::localeconv()),
thousands_sep(loc->thousands_sep == nullptr ? '\0' : loc->thousands_sep[0]),
decimal_point(loc->decimal_point == nullptr ? '\0' : loc->decimal_point[0]),
indent_char(ichar), indent_string(512, indent_char) {}
Expand Down Expand Up @@ -6557,6 +6557,9 @@ class serializer
+ (s[i + 3] & 0x7F);
break;
}

default:
break; // LCOV_EXCL_LINE
}

escape_codepoint(codepoint, result, pos);
Expand Down Expand Up @@ -6764,10 +6767,7 @@ class json_ref
{
return std::move(*value_ref);
}
else
{
return *value_ref;
}
return *value_ref;
}

value_type const& operator*() const
Expand Down Expand Up @@ -10255,10 +10255,8 @@ class basic_json

return default_value;
}
else
{
JSON_THROW(type_error::create(306, "cannot use value() with " + std::string(type_name())));
}

JSON_THROW(type_error::create(306, "cannot use value() with " + std::string(type_name())));
}

/*!
Expand Down

0 comments on commit 0b5e8f8

Please sign in to comment.