Code cleanup: use empty() to check size() == 0

pull/12/head
Tatsuhiro Tsujikawa 2012-02-12 23:21:25 +09:00
parent 7dc2b9ff16
commit 9e302b86df
2 changed files with 2 additions and 2 deletions

View File

@ -143,7 +143,7 @@ void DHTBucket::cacheNode(const SharedHandle<DHTNode>& node)
void DHTBucket::dropNode(const SharedHandle<DHTNode>& node)
{
if(cachedNodes_.size()) {
if(!cachedNodes_.empty()) {
std::deque<SharedHandle<DHTNode> >::iterator itr =
std::find_if(nodes_.begin(), nodes_.end(), derefEqual(node));
if(itr != nodes_.end()) {

View File

@ -219,7 +219,7 @@ std::string HttpRequest::createRequest()
val += base64::encode(authText.begin(), authText.end());
builtinHds.push_back(std::make_pair("Authorization:", val));
}
if(getPreviousURI().size()) {
if(!getPreviousURI().empty()) {
builtinHds.push_back(std::make_pair("Referer:", getPreviousURI()));
}
if(cookieStorage_) {