You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
37 lines
792 B
C++
37 lines
792 B
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#pragma once
|
|
|
|
#include "Containers/StringView.h"
|
|
|
|
namespace UE {
|
|
namespace Trace {
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
template <typename T>
|
|
inline uint32 QuickStoreHash(const T* String)
|
|
{
|
|
uint32 Value = 5381;
|
|
for (; *String; ++String)
|
|
{
|
|
Value = ((Value << 5) + Value) + *String;
|
|
}
|
|
return Value;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
template <typename CharType>
|
|
inline uint32 QuickStoreHash(TStringView<CharType> View)
|
|
{
|
|
const CharType* String = View.GetData();
|
|
uint32 Value = 5381;
|
|
for (int i = View.Len(); i > 0; --i, ++String)
|
|
{
|
|
Value = ((Value << 5) + Value) + *String;
|
|
}
|
|
return Value;
|
|
}
|
|
|
|
} // namespace Trace
|
|
} // namespace UE
|