Fix false positive compiler warning

This commit is contained in:
Lars Müller 2024-12-04 18:19:12 +01:00 committed by GitHub
parent a45b04ffb4
commit 18caf3a18d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -791,7 +791,8 @@ std::optional<std::vector<u16>> SelfType::MeshExtractor::getIndices(
index = std::get<Accessor<u16>>(accessor).get(elemIdx); index = std::get<Accessor<u16>>(accessor).get(elemIdx);
if (index == std::numeric_limits<u16>::max()) if (index == std::numeric_limits<u16>::max())
throw std::runtime_error("invalid index"); throw std::runtime_error("invalid index");
} else if (std::holds_alternative<Accessor<u32>>(accessor)) { } else {
_IRR_DEBUG_BREAK_IF(!std::holds_alternative<Accessor<u32>>(accessor));
u32 indexWide = std::get<Accessor<u32>>(accessor).get(elemIdx); u32 indexWide = std::get<Accessor<u32>>(accessor).get(elemIdx);
// Use >= here for consistency. // Use >= here for consistency.
if (indexWide >= std::numeric_limits<u16>::max()) if (indexWide >= std::numeric_limits<u16>::max())