Optimize loops calling endInstances()
Thankies to Drake Arconis/Alchemy~
This commit is contained in:
@@ -59,7 +59,7 @@ void LFFloaterInvPanel::closeAll()
|
||||
{
|
||||
// We must make a copy first, because LLInstanceTracker doesn't allow destruction while having iterators to it.
|
||||
std::vector<LFFloaterInvPanel*> cache;
|
||||
for (instance_iter i = beginInstances(); i != endInstances(); ++i)
|
||||
for (instance_iter i = beginInstances(), end(endInstances()); i != end; ++i)
|
||||
{
|
||||
cache.push_back(&*i);
|
||||
}
|
||||
|
||||
@@ -981,7 +981,7 @@ void LLFloaterProperties::closeByID(const LLUUID& item_id, const LLUUID &object_
|
||||
//static
|
||||
void LLFloaterProperties::dirtyAll()
|
||||
{
|
||||
for(instance_iter it = beginInstances();it!=endInstances();++it)
|
||||
for(instance_iter it = beginInstances(), it_end(endInstances()); it != it_end; ++it)
|
||||
{
|
||||
it->dirty();
|
||||
}
|
||||
|
||||
@@ -149,8 +149,7 @@ void LLFloaterWebContent::showInstance(const std::string& window_class, Params&
|
||||
|
||||
LLSD key = p;
|
||||
|
||||
instance_iter it = beginInstances();
|
||||
for(;it!=endInstances();++it)
|
||||
for(instance_iter it(beginInstances()), it_end(endInstances()); it != it_end; ++it)
|
||||
{
|
||||
if(it->mKey["window_class"].asString() == window_class)
|
||||
{
|
||||
@@ -255,8 +254,7 @@ void LLFloaterWebContent::preCreate(LLFloaterWebContent::Params& p)
|
||||
|
||||
std::vector<LLFloaterWebContent*> instances;
|
||||
instances.reserve(instanceCount());
|
||||
instance_iter it = beginInstances();
|
||||
for(;it!=endInstances();++it)
|
||||
for(instance_iter it(beginInstances()), it_end(endInstances()); it != it_end;++it)
|
||||
{
|
||||
if(it->mKey["window_class"].asString() == p.window_class.getValue())
|
||||
instances.push_back(&*it);
|
||||
|
||||
@@ -68,8 +68,7 @@ void LLFloaterWebProfile::showInstance(const std::string& window_class, Params&
|
||||
|
||||
LLSD key = p;
|
||||
|
||||
instance_iter it = beginInstances();
|
||||
for(;it!=endInstances();++it)
|
||||
for(instance_iter it(beginInstances()), it_end(endInstances()); it != it_end; ++it)
|
||||
{
|
||||
if(it->mKey["window_class"].asString() == window_class)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user