mirror of https://github.com/aria2/aria2
2008-05-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Defined static const std::string IP("ip"), PORT("port") and use them instead of string literals. * src/DefaultPeerListProcessor.cc * src/DefaultPeerListProcessor.hpull/1/head
parent
9d24736208
commit
1aeefb5c4b
|
@ -1,3 +1,10 @@
|
|||
2008-05-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Defined static const std::string IP("ip"), PORT("port") and use them
|
||||
instead of string literals.
|
||||
* src/DefaultPeerListProcessor.cc
|
||||
* src/DefaultPeerListProcessor.h
|
||||
|
||||
2008-05-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||
|
||||
Made string literals for torrent file processing static const
|
||||
|
|
|
@ -40,6 +40,10 @@
|
|||
|
||||
namespace aria2 {
|
||||
|
||||
const std::string DefaultPeerListProcessor::IP("ip");
|
||||
|
||||
const std::string DefaultPeerListProcessor::PORT("port");
|
||||
|
||||
DefaultPeerListProcessor::DefaultPeerListProcessor() {}
|
||||
|
||||
DefaultPeerListProcessor::~DefaultPeerListProcessor() {}
|
||||
|
@ -63,8 +67,8 @@ void DefaultPeerListProcessor::extractPeer
|
|||
if(!peerDic) {
|
||||
break;
|
||||
}
|
||||
const Data* ip = dynamic_cast<const Data*>(peerDic->get("ip"));
|
||||
const Data* port = dynamic_cast<const Data*>(peerDic->get("port"));
|
||||
const Data* ip = dynamic_cast<const Data*>(peerDic->get(IP));
|
||||
const Data* port = dynamic_cast<const Data*>(peerDic->get(PORT));
|
||||
if(!ip || !port || !port->isNumber()) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -40,6 +40,10 @@
|
|||
namespace aria2 {
|
||||
|
||||
class DefaultPeerListProcessor : public PeerListProcessor {
|
||||
private:
|
||||
static const std::string IP;
|
||||
|
||||
static const std::string PORT;
|
||||
public:
|
||||
DefaultPeerListProcessor();
|
||||
|
||||
|
|
Loading…
Reference in New Issue