Skip to content

Commit

Permalink
please...
Browse files Browse the repository at this point in the history
  • Loading branch information
p0358 committed Nov 5, 2023
1 parent 9c375cd commit 33b44eb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,13 @@ inline JsonValue* GetObjMember(JsonValue* obj, const char* name)
return nullptr;
}

inline JsonValue* GetArrMember(JsonValue* obj, const char* arrayName, int idx)
inline JsonValue* GetArrMember(JsonValue* obj, const char* arrayName, unsigned int idx)
{
if (obj) {
auto member = obj->FindMember(arrayName);
if (member != obj->MemberEnd() && member->value.IsArray()) {
auto& arr = member->value.GetArray();
if (arr.Size() >= idx + 1) {
return &arr[idx];
if (member->value.GetArray().Size() >= idx + 1u) {
return &member->value.GetArray()[idx];
}
}
}
Expand Down

0 comments on commit 33b44eb

Please sign in to comment.