Issue found with PVS-Studio:

Many instances of a function or expression being used repeatedly, which can lower performance.

Fixed it in these cases by creating on local var, reference or pointer that's used instead.
This commit is contained in:
Areloch 2015-07-13 22:51:17 -05:00
parent ec63398042
commit 2002d74b78
38 changed files with 465 additions and 371 deletions

View file

@ -1041,7 +1041,8 @@ void GFXTextureManager::_validateTexParams( const U32 width, const U32 height,
}
// inOutFormat is not modified by this method
bool chekFmt = GFX->getCardProfiler()->checkFormat( testingFormat, profile, autoGenSupp );
GFXCardProfiler* cardProfiler = GFX->getCardProfiler();
bool chekFmt = cardProfiler->checkFormat(testingFormat, profile, autoGenSupp);
if( !chekFmt )
{
@ -1057,16 +1058,16 @@ void GFXTextureManager::_validateTexParams( const U32 width, const U32 height,
{
case GFXFormatR8G8B8:
testingFormat = GFXFormatR8G8B8X8;
chekFmt = GFX->getCardProfiler()->checkFormat( testingFormat, profile, autoGenSupp );
chekFmt = cardProfiler->checkFormat(testingFormat, profile, autoGenSupp);
break;
case GFXFormatA8:
testingFormat = GFXFormatR8G8B8A8;
chekFmt = GFX->getCardProfiler()->checkFormat( testingFormat, profile, autoGenSupp );
chekFmt = cardProfiler->checkFormat(testingFormat, profile, autoGenSupp);
break;
default:
chekFmt = GFX->getCardProfiler()->checkFormat( testingFormat, profile, autoGenSupp );
chekFmt = cardProfiler->checkFormat(testingFormat, profile, autoGenSupp);
break;
}
}