From 9e302b86df6ed9ada7399c91fb33a8d955912d59 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 12 Feb 2012 23:21:25 +0900 Subject: [PATCH] Code cleanup: use empty() to check size() == 0 --- src/DHTBucket.cc | 2 +- src/HttpRequest.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DHTBucket.cc b/src/DHTBucket.cc index 75330be4..3e2f62bb 100644 --- a/src/DHTBucket.cc +++ b/src/DHTBucket.cc @@ -143,7 +143,7 @@ void DHTBucket::cacheNode(const SharedHandle& node) void DHTBucket::dropNode(const SharedHandle& node) { - if(cachedNodes_.size()) { + if(!cachedNodes_.empty()) { std::deque >::iterator itr = std::find_if(nodes_.begin(), nodes_.end(), derefEqual(node)); if(itr != nodes_.end()) { diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index d35acc96..3ebf7f24 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -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_) {