]> git.tdb.fi Git - r2c2.git/commitdiff
Use deque rather than list for queues
authorMikko Rasa <tdb@tdb.fi>
Thu, 19 Feb 2015 13:30:03 +0000 (15:30 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 19 Feb 2015 13:30:03 +0000 (15:30 +0200)
List makes one allocation for every item, deque only one per a bunch of
items.

source/libr2c2/arducontrol.h

index a48f6f0990aa59997b9c45bdde7778cd3506c17c..d68a149a9275c957b5207e906d4f9586e3d63e9b 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef LIBR2C2_ARDUCONTROL_H_
 #define LIBR2C2_ARDUCONTROL_H_
 
+#include <deque>
 #include <msp/core/mutex.h>
 #include <msp/core/thread.h>
 #include <msp/datafile/objectloader.h>
@@ -214,7 +215,7 @@ private:
        class Queue
        {
        private:
-               std::list<T> items;
+               std::deque<T> items;
                Msp::Mutex mutex;
 
        public: