mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 04:38:49 +00:00
Common: update 'ReadNumericOrDefault' to 'ReadNumericFromJson' and have it return an optional, this provides the caller with more flexibility
This commit is contained in:
parent
85dee300b5
commit
69694494ce
2 changed files with 7 additions and 7 deletions
|
@ -14,7 +14,7 @@ picojson::object ToJsonObject(const Common::Vec3& vec)
|
|||
|
||||
void FromJson(const picojson::object& obj, Common::Vec3& vec)
|
||||
{
|
||||
vec.x = ReadNumericOrDefault<float>(obj, "x");
|
||||
vec.y = ReadNumericOrDefault<float>(obj, "y");
|
||||
vec.z = ReadNumericOrDefault<float>(obj, "z");
|
||||
vec.x = ReadNumericFromJson<float>(obj, "x").value_or(0.0f);
|
||||
vec.y = ReadNumericFromJson<float>(obj, "y").value_or(0.0f);
|
||||
vec.z = ReadNumericFromJson<float>(obj, "z").value_or(0.0f);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue