Use binary search in CNullDriver::removeTexture()

This commit is contained in:
sfan5 2023-09-13 12:33:50 +02:00
parent af20d9ff86
commit 7298b46504
1 changed files with 6 additions and 8 deletions

View File

@ -283,15 +283,13 @@ void CNullDriver::removeTexture(ITexture* texture)
{ {
if (!texture) if (!texture)
return; return;
SSurface s;
s.Surface = texture;
for (u32 i=0; i<Textures.size(); ++i) s32 index = Textures.binary_search(s);
{ if (index != -1) {
if (Textures[i].Surface == texture) texture->drop();
{ Textures.erase(index);
texture->drop();
Textures.erase(i);
return;
}
} }
} }