mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-18 03:29:46 +02:00
clang-tidy fixes again (#1087)
* [clang-tidy] Do not use else after return Found with readability-else-after-return Signed-off-by: Rosen Penev <rosenp@gmail.com> * [clang-tidy] Convert several loops to be range based Found with modernize-loop-convert Signed-off-by: Rosen Penev <rosenp@gmail.com> * [clang-tidy] Replace deprecated C headers Found with modernize-deprecated-headers Signed-off-by: Rosen Penev <rosenp@gmail.com> * [clang-tidy] Use auto where applicable Found with modernize-use-auto Signed-off-by: Rosen Penev <rosenp@gmail.com> * .clang-tidy: Add these checks
This commit is contained in:
@@ -875,8 +875,7 @@ ArrayIndex Value::size() const {
|
||||
bool Value::empty() const {
|
||||
if (isNull() || isArray() || isObject())
|
||||
return size() == 0U;
|
||||
else
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
Value::operator bool() const { return !isNull(); }
|
||||
@@ -1137,13 +1136,12 @@ bool Value::insert(ArrayIndex index, Value&& newValue) {
|
||||
ArrayIndex length = size();
|
||||
if (index > length) {
|
||||
return false;
|
||||
} else {
|
||||
for (ArrayIndex i = length; i > index; i--) {
|
||||
(*this)[i] = std::move((*this)[i - 1]);
|
||||
}
|
||||
(*this)[index] = std::move(newValue);
|
||||
return true;
|
||||
}
|
||||
for (ArrayIndex i = length; i > index; i--) {
|
||||
(*this)[i] = std::move((*this)[i - 1]);
|
||||
}
|
||||
(*this)[index] = std::move(newValue);
|
||||
return true;
|
||||
}
|
||||
|
||||
Value Value::get(char const* begin, char const* end,
|
||||
|
Reference in New Issue
Block a user