You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
38 lines
653 B
C++
38 lines
653 B
C++
|
|
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
||
|
|
|
||
|
|
#include "Engine.h"
|
||
|
|
#include "HashTable.h"
|
||
|
|
|
||
|
|
uint32 FHashTable::EmptyHash[1] = { ~0u };
|
||
|
|
|
||
|
|
void FHashTable::Resize( uint32 NewIndexSize )
|
||
|
|
{
|
||
|
|
if( NewIndexSize == IndexSize )
|
||
|
|
{
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
if( NewIndexSize == 0 )
|
||
|
|
{
|
||
|
|
Free();
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
|
||
|
|
if( IndexSize == 0 )
|
||
|
|
{
|
||
|
|
HashMask = HashSize - 1;
|
||
|
|
Hash = new uint32[ HashSize ];
|
||
|
|
FMemory::Memset( Hash, 0xff, HashSize * 4 );
|
||
|
|
}
|
||
|
|
|
||
|
|
uint32* NewNextIndex = new uint32[ NewIndexSize ];
|
||
|
|
|
||
|
|
if( NextIndex )
|
||
|
|
{
|
||
|
|
FMemory::Memcpy( NewNextIndex, NextIndex, IndexSize * 4 );
|
||
|
|
delete[] NextIndex;
|
||
|
|
}
|
||
|
|
|
||
|
|
IndexSize = NewIndexSize;
|
||
|
|
NextIndex = NewNextIndex;
|
||
|
|
}
|