Skip to content

Commit

Permalink
Review update
Browse files Browse the repository at this point in the history
  • Loading branch information
lordgamez committed Nov 4, 2024
1 parent 0b86be8 commit 65aed8f
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions libminifi/src/core/RecordField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,29 +68,29 @@ RecordField RecordField::fromJson(const rapidjson::Value& value) {
if (value.IsString()) {
std::string str_value = value.GetString();
if (auto test_time = utils::timeutils::parseDateTimeStr(str_value)) {
return RecordField(std::chrono::time_point{*test_time});
return RecordField{std::chrono::time_point{*test_time}};
}
return RecordField(str_value);
return RecordField{str_value};
} else if (value.IsInt64()) {
return RecordField(value.GetInt64());
return RecordField{value.GetInt64()};
} else if (value.IsUint64()) {
return RecordField(value.GetUint64());
return RecordField{value.GetUint64()};
} else if (value.IsDouble()) {
return RecordField(value.GetDouble());
return RecordField{value.GetDouble()};
} else if (value.IsBool()) {
return RecordField(value.GetBool());
return RecordField{value.GetBool()};
} else if (value.IsArray()) {
RecordArray arr;
for (const auto& elem : value.GetArray()) {
arr.push_back(RecordField::fromJson(elem));
}
return RecordField(std::move(arr));
return RecordField{std::move(arr)};
} else if (value.IsObject()) {
RecordObject obj;
for (const auto& member : value.GetObject()) {
obj.emplace(member.name.GetString(), BoxedRecordField(std::make_unique<RecordField>(RecordField::fromJson(member.value))));
obj.emplace(member.name.GetString(), BoxedRecordField{std::make_unique<RecordField>(RecordField::fromJson(member.value))});
}
return RecordField(std::move(obj));
return RecordField{std::move(obj)};
} else {
throw std::runtime_error("Invalid JSON value type");
}
Expand Down

0 comments on commit 65aed8f

Please sign in to comment.