diff --git a/ChangeLog b/ChangeLog index ab283267..5db838a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-05-14 Tatsuhiro Tsujikawa + + 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 Made string literals for torrent file processing static const diff --git a/src/DefaultPeerListProcessor.cc b/src/DefaultPeerListProcessor.cc index 5fc72163..a72d19b0 100644 --- a/src/DefaultPeerListProcessor.cc +++ b/src/DefaultPeerListProcessor.cc @@ -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(peerDic->get("ip")); - const Data* port = dynamic_cast(peerDic->get("port")); + const Data* ip = dynamic_cast(peerDic->get(IP)); + const Data* port = dynamic_cast(peerDic->get(PORT)); if(!ip || !port || !port->isNumber()) { continue; } diff --git a/src/DefaultPeerListProcessor.h b/src/DefaultPeerListProcessor.h index b7e68d0a..371fe57d 100644 --- a/src/DefaultPeerListProcessor.h +++ b/src/DefaultPeerListProcessor.h @@ -40,6 +40,10 @@ namespace aria2 { class DefaultPeerListProcessor : public PeerListProcessor { +private: + static const std::string IP; + + static const std::string PORT; public: DefaultPeerListProcessor();