mirror of
https://github.com/Mr-X-GTA/GTAV-Classes-1.git
synced 2026-10-10 03:43:17 +08:00
feat: make rage::joaat consteval compatible (#96)
* feat(joaat): make consteval compatible * fix(ObfVar): ctime include * feat(joaat): consteval -> constexpr
This commit is contained in:
+4
-3
@@ -8,13 +8,14 @@ namespace rage
|
||||
using joaat_t = std::uint32_t;
|
||||
inline constexpr char joaat_to_lower(char c)
|
||||
{
|
||||
return (c >= 'A' && c <= 'Z') ? c + ('a' - 'A') : c;
|
||||
return c >= 'A' && c <= 'Z' ? c | 1 << 5 : c;
|
||||
}
|
||||
|
||||
inline joaat_t joaat(std::string_view str)
|
||||
inline constexpr joaat_t joaat(const std::string_view str)
|
||||
{
|
||||
joaat_t hash = 0;
|
||||
for (auto c : str) {
|
||||
for (auto c : str)
|
||||
{
|
||||
hash += joaat_to_lower(c);
|
||||
hash += (hash << 10);
|
||||
hash ^= (hash >> 6);
|
||||
|
||||
Reference in New Issue
Block a user