Files
UnrealEngineUWP/Engine/Source/Developer/TraceAnalysis/Private/Store/Utils.h
ionut matasaru a6382278a3 [TraceAnalysis] Removed TRACE_WITH_ASIO toggle macro.
#rb Martin.Ridgers

[CL 11091671 by ionut matasaru in Dev-Core branch]
2020-01-23 06:31:29 -05:00

36 lines
763 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Containers/StringView.h"
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(TStringViewImpl<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