mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-18 13:43:48 +01:00
Use binary search in CNullDriver::removeTexture()
This commit is contained in:
parent
af20d9ff86
commit
7298b46504
@ -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();
|
texture->drop();
|
||||||
Textures.erase(i);
|
Textures.erase(index);
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user