Optimize loops calling endInstances()
Thankies to Drake Arconis/Alchemy~
This commit is contained in:
@@ -65,7 +65,7 @@ LLEventTimer::~LLEventTimer()
|
||||
void LLEventTimer::updateClass()
|
||||
{
|
||||
std::list<LLEventTimer*> completed_timers;
|
||||
for (instance_iter iter = beginInstances(); iter != endInstances(); )
|
||||
for (instance_iter iter = beginInstances(), iter_end = endInstances(); iter != iter_end;)
|
||||
{
|
||||
LLEventTimer& timer = *iter++;
|
||||
F32 et = timer.mEventTimer.getElapsedTimeF32();
|
||||
|
||||
@@ -345,7 +345,7 @@ LLFastTimer::DeclareTimer::DeclareTimer(const std::string& name)
|
||||
void LLFastTimer::updateCachedPointers()
|
||||
{
|
||||
// Update DeclareTimer::mFrameState pointers.
|
||||
for (DeclareTimer::instance_iter it = DeclareTimer::beginInstances(); it != DeclareTimer::endInstances(); ++it)
|
||||
for (DeclareTimer::instance_iter it = DeclareTimer::beginInstances(), it_end = DeclareTimer::endInstances(); it != it_end; ++it)
|
||||
{
|
||||
// update cached pointer
|
||||
it->mFrameState = &it->mTimer.getFrameState();
|
||||
@@ -537,7 +537,7 @@ void LLFastTimer::NamedTimer::buildHierarchy()
|
||||
|
||||
// set up initial tree
|
||||
{
|
||||
for (instance_iter it = beginInstances(); it != endInstances(); ++it)
|
||||
for (instance_iter it = beginInstances(), it_end = endInstances(); it != it_end; ++it)
|
||||
{
|
||||
NamedTimer& timer = *it;
|
||||
if (&timer == NamedTimerFactory::instance().getRootTimer()) continue;
|
||||
@@ -677,7 +677,7 @@ void LLFastTimer::NamedTimer::resetFrame()
|
||||
LLSD sd;
|
||||
|
||||
{
|
||||
for (instance_iter it = beginInstances(); it != endInstances(); ++it)
|
||||
for (instance_iter it = beginInstances(), it_end = endInstances(); it != it_end; ++it)
|
||||
{
|
||||
NamedTimer& timer = *it;
|
||||
FrameState& info = timer.getFrameState();
|
||||
@@ -721,7 +721,7 @@ void LLFastTimer::NamedTimer::resetFrame()
|
||||
|
||||
// reset for next frame
|
||||
{
|
||||
for (instance_iter it = beginInstances(); it != endInstances(); ++it)
|
||||
for (instance_iter it = beginInstances(), it_end = endInstances(); it != it_end; ++it)
|
||||
{
|
||||
NamedTimer& timer = *it;
|
||||
|
||||
@@ -765,7 +765,7 @@ void LLFastTimer::NamedTimer::reset()
|
||||
|
||||
// reset all history
|
||||
{
|
||||
for (instance_iter it = beginInstances(); it != endInstances(); ++it)
|
||||
for (instance_iter it = beginInstances(), it_end = endInstances(); it != it_end; ++it)
|
||||
{
|
||||
NamedTimer& timer = *it;
|
||||
if (&timer != NamedTimerFactory::instance().getRootTimer())
|
||||
|
||||
@@ -2320,7 +2320,7 @@ void LLGLNamePool::release(GLuint name)
|
||||
//static
|
||||
void LLGLNamePool::upkeepPools()
|
||||
{
|
||||
for (tracker_t::instance_iter iter = beginInstances(); iter != endInstances(); ++iter)
|
||||
for (tracker_t::instance_iter iter = beginInstances(), iter_end = endInstances(); iter != iter_end; ++iter)
|
||||
{
|
||||
LLGLNamePool & pool = *iter;
|
||||
pool.upkeep();
|
||||
@@ -2330,7 +2330,7 @@ void LLGLNamePool::upkeepPools()
|
||||
//static
|
||||
void LLGLNamePool::cleanupPools()
|
||||
{
|
||||
for (tracker_t::instance_iter iter = beginInstances(); iter != endInstances(); ++iter)
|
||||
for (tracker_t::instance_iter iter = beginInstances(), iter_end = endInstances(); iter != iter_end; ++iter)
|
||||
{
|
||||
LLGLNamePool & pool = *iter;
|
||||
pool.cleanup();
|
||||
|
||||
@@ -534,7 +534,7 @@ void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp)
|
||||
//static
|
||||
void LLLayoutStack::updateClass()
|
||||
{
|
||||
for (instance_iter it = beginInstances(); it != endInstances(); ++it)
|
||||
for (instance_iter it = beginInstances(), it_end(endInstances()); it != it_end; ++it)
|
||||
{
|
||||
it->updateLayout();
|
||||
it->mAnimatedThisFrame = false;
|
||||
|
||||
@@ -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