2008-05-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Made string literal to static const std::string
	* src/BtChokeMessage.cc (toString)
	* src/BtHaveAllMessage.cc (toString)
	* src/BtHaveNoneMessage.cc (toString)
	* src/BtInterestedMessage.cc (toString)
	* src/BtNotInterestedMessage.cc (toString)
	* src/BtUnchokeMessage.cc (toString)
pull/1/head
Tatsuhiro Tsujikawa 2008-05-13 14:25:27 +00:00
parent 386d19693b
commit 5c8db1cc20
7 changed files with 22 additions and 6 deletions

View File

@ -1,3 +1,13 @@
2008-05-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made string literal to static const std::string
* src/BtChokeMessage.cc (toString)
* src/BtHaveAllMessage.cc (toString)
* src/BtHaveNoneMessage.cc (toString)
* src/BtInterestedMessage.cc (toString)
* src/BtNotInterestedMessage.cc (toString)
* src/BtUnchokeMessage.cc (toString)
2008-05-13 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Replaced "" with static const variable A2STR::NIL.

View File

@ -92,7 +92,8 @@ void BtChokeMessage::onSendComplete() {
}
std::string BtChokeMessage::toString() const {
return "choke";
static const std::string CHOKE("choke");
return CHOKE;
}
} // namespace aria2

View File

@ -87,7 +87,8 @@ size_t BtHaveAllMessage::getMessageLength() {
}
std::string BtHaveAllMessage::toString() const {
return "have all";
static const std::string HAVE_ALL("have all");
return HAVE_ALL;
}
} // namespace aria2

View File

@ -83,7 +83,8 @@ size_t BtHaveNoneMessage::getMessageLength() {
}
std::string BtHaveNoneMessage::toString() const {
return "have none";
static const std::string HAVE_NONE("have none");
return HAVE_NONE;
}
} // namespace aria2

View File

@ -93,7 +93,8 @@ void BtInterestedMessage::onSendComplete() {
}
std::string BtInterestedMessage::toString() const {
return "interested";
static const std::string INTERESTED("interested");
return INTERESTED;
}
} // namespace aria2

View File

@ -93,7 +93,8 @@ void BtNotInterestedMessage::onSendComplete() {
}
std::string BtNotInterestedMessage::toString() const {
return "not interested";
static const std::string NOT_INTERESTED("not interested");
return NOT_INTERESTED;
}
} // namespace aria2

View File

@ -87,7 +87,8 @@ void BtUnchokeMessage::onSendComplete() {
}
std::string BtUnchokeMessage::toString() const {
return "unchoke";
static const std::string UNCHOKE("unchoke");
return UNCHOKE;
}
} // namespace aria2