diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-02-28 12:30:11 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-02-28 12:30:11 +0000 |
| commit | c342bde9627b434effbc0cd10b817670d1da0923 (patch) | |
| tree | 60d14bf448066b8dcd639adfa0db716d5a8258c8 /src/CookieStorage.h | |
| parent | 135f0a2a8c4ee04a5e96d84ba558245fabfc1f5c (diff) | |
2010-02-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Use vector instead of deque for containers which is used for
mostly read-only purpose.
Diffstat (limited to 'src/CookieStorage.h')
| -rw-r--r-- | src/CookieStorage.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/CookieStorage.h b/src/CookieStorage.h index 1d343725..eaac2bce 100644 --- a/src/CookieStorage.h +++ b/src/CookieStorage.h @@ -39,6 +39,7 @@ #include <string> #include <deque> +#include <vector> #include <algorithm> #include "a2time.h" @@ -122,7 +123,13 @@ private: Logger* _logger; - void storeCookies(const std::deque<Cookie>& cookies); + template<typename InputIterator> + void storeCookies(InputIterator first, InputIterator last) + { + for(; first != last; ++first) { + store(*first); + } + } public: CookieStorage(); @@ -140,9 +147,9 @@ public: // Finds cookies matched with given criteria and returns them. // Matched cookies' _lastAccess property is updated. - std::deque<Cookie> criteriaFind(const std::string& requestHost, - const std::string& requestPath, - time_t date, bool secure); + std::vector<Cookie> criteriaFind(const std::string& requestHost, + const std::string& requestPath, + time_t date, bool secure); // Loads Cookies from file denoted by filename. If compiled with // libsqlite3, this method automatically detects the specified file |
