allpy
changeset 843:3a712982ceb8
blocks3d/wt: use vector instead of list as container for tasks
Actions are needed from this container:
* remove_if
* size
* push_back
list should have constant size(), but it has linear size in
some implementations (for example, in g++).
author | boris <bnagaev@gmail.com> |
---|---|
date | Wed, 20 Jul 2011 02:42:04 +0200 |
parents | d60f272dc921 |
children | 2ab571ea8101 |
files | blocks3d/wt/blocks3d-wt-widget.C |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line diff
1.1 --- a/blocks3d/wt/blocks3d-wt-widget.C Wed Jul 20 02:38:59 2011 +0400 1.2 +++ b/blocks3d/wt/blocks3d-wt-widget.C Wed Jul 20 02:42:04 2011 +0200 1.3 @@ -4,7 +4,8 @@ 1.4 #include <boost/format.hpp> 1.5 #include <boost/foreach.hpp> 1.6 #include <cstdlib> 1.7 -#include <list> 1.8 +#include <vector> 1.9 +#include <algorithm> 1.10 #include <string> 1.11 1.12 #include "config.h" 1.13 @@ -19,7 +20,7 @@ 1.14 #include <Wt/WAnchor> 1.15 #include <Wt/WFileResource> 1.16 1.17 -std::list<std::string> current_taks; 1.18 +std::vector<std::string> current_taks; 1.19 1.20 Blocks3DWidget::Blocks3DWidget(Wt::WContainerWidget* parent) : 1.21 Wt::WContainerWidget(parent), 1.22 @@ -188,7 +189,7 @@ 1.23 1.24 void Blocks3DWidget::try_to_run() 1.25 { 1.26 - current_taks.remove_if(&Blocks3DWidget::is_completed); 1.27 + std::remove_if(current_taks.begin(), current_taks.end(), &Blocks3DWidget::is_completed); 1.28 if (current_taks.size() >= Malakite::max_simultaneous_tasks) 1.29 { 1.30 new Wt::WBreak(results_panel);