diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-03-23 01:34:37 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-03-23 01:34:37 +0900 |
| commit | eed804baaa02b4f81a27ba2844868b19992a90a1 (patch) | |
| tree | f6c5741443a979593fe080422ac78ef1b0f699d2 /src/ServerStatMan.h | |
| parent | 4acc0f88317287b86c6b89ba5e5262d3ebd30cc9 (diff) | |
Use std::set instead of std::deque if the elements are sorted and
insertions and deletions are frequent.
Diffstat (limited to 'src/ServerStatMan.h')
| -rw-r--r-- | src/ServerStatMan.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ServerStatMan.h b/src/ServerStatMan.h index 47a8c075..725fdc7c 100644 --- a/src/ServerStatMan.h +++ b/src/ServerStatMan.h @@ -37,10 +37,11 @@ #include "common.h" #include <string> -#include <deque> +#include <set> #include "SharedHandle.h" #include "a2time.h" +#include "a2functional.h" namespace aria2 { @@ -63,7 +64,9 @@ public: void removeStaleServerStat(time_t timeout); private: - std::deque<SharedHandle<ServerStat> > serverStats_; + typedef std::set<SharedHandle<ServerStat>, + DerefLess<SharedHandle<ServerStat> > > ServerStatSet; + ServerStatSet serverStats_; }; } // namespace aria2 |
