From 825cfe7715fee70e08a76f87cf2803602d3c5fed Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 11 May 2008 09:36:39 +0000 Subject: 2008-05-11 Tatsuhiro Tsujikawa Pass std::deque by reference to avoid unnecessary coping. * src/AbstractCommand.cc * src/BtCheckIntegrityEntry.cc * src/BtCheckIntegrityEntry.h * src/BtFileAllocationEntry.cc * src/BtFileAllocationEntry.h * src/BtSetup.cc * src/BtSetup.h * src/CheckIntegrityCommand.cc * src/CheckIntegrityEntry.h * src/ChecksumCheckIntegrityEntry.cc * src/ChecksumCheckIntegrityEntry.h * src/DHTSetup.cc * src/DHTSetup.h * src/DownloadEngine.cc * src/FileAllocationCommand.cc * src/FileAllocationEntry.h * src/RequestGroup.cc * src/RequestGroup.h * src/RequestGroupMan.cc * src/RequestGroupMan.h * src/StreamCheckIntegrityEntry.cc * src/StreamCheckIntegrityEntry.h * src/StreamFileAllocationEntry.cc * src/StreamFileAllocationEntry.h * src/TrackerWatcherCommand.cc * src/a2functional.h --- src/BtFileAllocationEntry.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/BtFileAllocationEntry.cc') diff --git a/src/BtFileAllocationEntry.cc b/src/BtFileAllocationEntry.cc index 19f70d8f..7d0b67cd 100644 --- a/src/BtFileAllocationEntry.cc +++ b/src/BtFileAllocationEntry.cc @@ -46,14 +46,13 @@ BtFileAllocationEntry::BtFileAllocationEntry(RequestGroup* requestGroup): BtFileAllocationEntry::~BtFileAllocationEntry() {} -Commands BtFileAllocationEntry::prepareForNextAction(DownloadEngine* e) +void BtFileAllocationEntry::prepareForNextAction(std::deque& commands, + DownloadEngine* e) { - Commands commands = BtSetup().setup(_requestGroup, e, e->option); + BtSetup().setup(commands, _requestGroup, e, e->option); if(!_requestGroup->downloadFinished()) { - Commands streamCommands = _requestGroup->createNextCommandWithAdj(e, 0); - std::copy(streamCommands.begin(), streamCommands.end(), std::back_inserter(commands)); + _requestGroup->createNextCommandWithAdj(commands, e, 0); } - return commands; } } // namespace aria2 -- cgit