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:
Kawe Mazidjatari
2025-06-22 14:09:45 +02:00
parent 02cba0fb86
commit c49e0d2123
+1 -1
View File
@@ -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);
}
//-----------------------------------------------------------------------------