summaryrefslogtreecommitdiff
path: root/src/SessionSerializer.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-03-01 23:13:24 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-03-03 18:00:42 +0900
commitd4ba562710c3d9630bd704e5731e1b234569536c (patch)
tree5aae5573315e7fb5b3cd48a4fcc0835f26c23184 /src/SessionSerializer.cc
parent421ae13d4084932f2504720eefdd8e6ed1cbffdc (diff)
Implement IndexedList::iterator
It is dangerous to expose internal iterator to the outside, which is easily misused.
Diffstat (limited to 'src/SessionSerializer.cc')
-rw-r--r--src/SessionSerializer.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/SessionSerializer.cc b/src/SessionSerializer.cc
index 45e7b591..d3d16f09 100644
--- a/src/SessionSerializer.cc
+++ b/src/SessionSerializer.cc
@@ -216,9 +216,9 @@ bool SessionSerializer::save(BufferedFile& fp) const
{
std::set<a2_gid_t> metainfoCache;
const DownloadResultList& results = rgman_->getDownloadResults();
- for(DownloadResultList::SeqType::const_iterator itr = results.begin(),
+ for(DownloadResultList::const_iterator itr = results.begin(),
eoi = results.end(); itr != eoi; ++itr) {
- const SharedHandle<DownloadResult>& dr = (*itr).second;
+ const SharedHandle<DownloadResult>& dr = *itr;
if(dr->result == error_code::FINISHED ||
dr->result == error_code::REMOVED) {
if(dr->option->getAsBool(PREF_FORCE_SAVE)) {
@@ -246,9 +246,9 @@ bool SessionSerializer::save(BufferedFile& fp) const
{
// Save active downloads.
const RequestGroupList& groups = rgman_->getRequestGroups();
- for(RequestGroupList::SeqType::const_iterator itr = groups.begin(),
+ for(RequestGroupList::const_iterator itr = groups.begin(),
eoi = groups.end(); itr != eoi; ++itr) {
- const SharedHandle<RequestGroup>& rg = (*itr).second;
+ const SharedHandle<RequestGroup>& rg = *itr;
SharedHandle<DownloadResult> dr = rg->createDownloadResult();
bool stopped = dr->result == error_code::FINISHED ||
dr->result == error_code::REMOVED;
@@ -262,9 +262,9 @@ bool SessionSerializer::save(BufferedFile& fp) const
}
if(saveWaiting_) {
const RequestGroupList& groups = rgman_->getReservedGroups();
- for(RequestGroupList::SeqType::const_iterator itr = groups.begin(),
+ for(RequestGroupList::const_iterator itr = groups.begin(),
eoi = groups.end(); itr != eoi; ++itr) {
- const SharedHandle<RequestGroup>& rg = (*itr).second;
+ const SharedHandle<RequestGroup>& rg = *itr;
SharedHandle<DownloadResult> result = rg->createDownloadResult();
if(!writeDownloadResult(fp, metainfoCache, result)) {
return false;