2009-04-22 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Avoid dynamic_pointer_cast.
	* src/DHTGetPeersCommand.cc
	* src/DHTGetPeersCommand.h
pull/1/head
Tatsuhiro Tsujikawa 2009-04-21 15:15:10 +00:00
parent afdd61f9d1
commit 0414c71956
2 changed files with 4 additions and 6 deletions

View File

@ -38,7 +38,6 @@
#include "DHTTask.h"
#include "DownloadEngine.h"
#include "RequestGroup.h"
#include "DHTPeerLookupTask.h"
#include "DHTNode.h"
#include "DHTNodeLookupEntry.h"
#include "BtContext.h"
@ -73,9 +72,8 @@ bool DHTGetPeersCommand::execute()
_lastGetPeerTime.elapsed(GET_PEER_INTERVAL))) {
logger->debug("Issuing PeerLookup for infoHash=%s",
_btContext->getInfoHashAsString().c_str());
_task = dynamic_pointer_cast<DHTPeerLookupTask>
(_taskFactory->createPeerLookupTask(_btContext, _btRuntime,
_peerStorage));
_task = _taskFactory->createPeerLookupTask(_btContext, _btRuntime,
_peerStorage);
_taskQueue->addPeriodicTask2(_task);
} else if(!_task.isNull() && _task->finished()) {
_lastGetPeerTime.reset();

View File

@ -44,7 +44,7 @@ namespace aria2 {
class DHTTaskQueue;
class DHTTaskFactory;
class DHTPeerLookupTask;
class DHTTask;
class DownloadEngine;
class RequestGroup;
class BtContext;
@ -73,7 +73,7 @@ private:
SharedHandle<DHTTaskFactory> _taskFactory;
SharedHandle<DHTPeerLookupTask> _task;
SharedHandle<DHTTask> _task;
size_t _numRetry;