From: Mikko Rasa Date: Wed, 14 Apr 2021 11:46:05 +0000 (+0300) Subject: Use a vector instead of a list for Sequence's steps X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=73facb40b97bb006a408ef93b866fbc6fd14d1c3;p=libs%2Fgl.git Use a vector instead of a list for Sequence's steps They're not large or numerous enough to warrant a list. --- diff --git a/source/render/sequence.cpp b/source/render/sequence.cpp index 6898e668..51b2a4f7 100644 --- a/source/render/sequence.cpp +++ b/source/render/sequence.cpp @@ -140,7 +140,7 @@ void Sequence::add_postprocessor(PostProcessor *pp, bool keep) void Sequence::setup_frame(Renderer &renderer) { - for(StepList::const_iterator i=steps.begin(); i!=steps.end(); ++i) + for(vector::const_iterator i=steps.begin(); i!=steps.end(); ++i) if(Renderable *renderable = i->get_renderable()) renderable->setup_frame(renderer); for(vector::const_iterator i=renderables.begin(); i!=renderables.end(); ++i) @@ -149,7 +149,7 @@ void Sequence::setup_frame(Renderer &renderer) void Sequence::finish_frame() { - for(StepList::const_iterator i=steps.begin(); i!=steps.end(); ++i) + for(vector::const_iterator i=steps.begin(); i!=steps.end(); ++i) if(Renderable *renderable = i->get_renderable()) renderable->finish_frame(); for(vector::const_iterator i=renderables.begin(); i!=renderables.end(); ++i) @@ -174,7 +174,7 @@ void Sequence::render(Renderer &renderer, Tag tag) const fbo.clear(); } - for(StepList::const_iterator i=steps.begin(); i!=steps.end(); ++i) + for(vector::const_iterator i=steps.begin(); i!=steps.end(); ++i) { if(const DepthTest *dt = i->get_depth_test()) dt->bind(); diff --git a/source/render/sequence.h b/source/render/sequence.h index 97d376d1..11f22a76 100644 --- a/source/render/sequence.h +++ b/source/render/sequence.h @@ -74,9 +74,7 @@ private: Slot(Renderable *); }; - typedef std::list StepList; - - StepList steps; + std::vector steps; const Camera *camera; std::vector renderables; std::vector > postproc;