Add missing loop

This commit is contained in:
Ricardo Luís Vaz Silva 2023-11-14 16:00:09 -03:00 committed by Christoph Oelckers
parent 747e55ce60
commit 3056786f38

View file

@ -2605,23 +2605,26 @@ static bool PMapValueReader(FSerializer &ar, M *map, const PMap *m)
const char * k;
if(m->KeyType == TypeName)
{
typename M::ValueType * val;
if constexpr(std::is_same_v<typename M::KeyType,uint32_t>)
while((k = ar.GetKey()))
{
val = &map->InsertNew(FName(k).GetIndex());
}
else
{
#ifdef __GNUC__
__builtin_unreachable();
#elif defined(_MSC_VER)
__assume(0);
#endif
}
if (!m->ValueType->ReadValue(ar,nullptr,static_cast<void*>(val)))
{
ar.EndObject();
return false;
typename M::ValueType * val;
if constexpr(std::is_same_v<typename M::KeyType,uint32_t>)
{
val = &map->InsertNew(FName(k).GetIndex());
}
else
{
#ifdef __GNUC__
__builtin_unreachable();
#elif defined(_MSC_VER)
__assume(0);
#endif
}
if (!m->ValueType->ReadValue(ar,nullptr,static_cast<void*>(val)))
{
ar.EndObject();
return false;
}
}
}
else