Files
UnrealEngineUWP/Engine/Source/Developer/TraceAnalysis/Private/Store/Utils.h
Martin Ridgers be972be826 Moved the Trace namespace into the UE namespace.
#rb jb
#rnx

[CL 14762673 by Martin Ridgers in ue5-main branch]
2020-11-17 06:54:28 -04:00

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