mirror of
https://github.com/Mauler125/r5sdk.git
synced 2026-09-15 21:02:13 +02:00
Tier2: improve branch prediction for JSON_StringToNumber()
Check for error before checking if the iterator points to the end of the string.
This commit is contained in:
@@ -362,7 +362,7 @@ inline bool JSON_StringToNumber(const char* const str, const size_t len, V& num)
|
||||
else
|
||||
static_assert(std::is_same_v<V, void>, "Cannot classify numeric type; unsupported.");
|
||||
|
||||
return (result.ptr == end) && (result.ec == std::errc());
|
||||
return (result.ec == std::errc()) && (result.ptr == end);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user