Skip to content
Permalink
Browse files
AssetLibrary FindAsset: Compare hashes before we compare strings
Load time 4.54s -> 4.40s
  • Loading branch information
rygorous committed Mar 4, 2013
1 parent b4e29b2 commit 40bde87
Showing 1 changed file with 2 additions and 0 deletions.
@@ -175,11 +175,13 @@ void *CPUTAssetLibrary::FindAsset(const cString &name, CPUTAssetListEntry *pList
CPUTOSServices *pServices = CPUTOSServices::GetOSServices();
pServices->ResolveAbsolutePathAndFilename( nameIsFullPathAndFilename ? name : (mAssetSetDirectoryName + name), &absolutePathAndFilename);
absolutePathAndFilename = nameIsFullPathAndFilename ? name : absolutePathAndFilename;
UINT hash = CPUTComputeHash( absolutePathAndFilename );

while(NULL!=pList)
{
if( pModel == pList->pModel
&& meshIndex == pList->meshIndex
&& hash == pList->hash
&& (0 == _wcsicmp( absolutePathAndFilename.data(), pList->name.data() ))
)
{

0 comments on commit 40bde87

Please sign in to comment.