summaryrefslogtreecommitdiff
path: root/src/cookie_helper.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-07-04 21:33:36 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-07-04 21:33:36 +0900
commit107de5899779d4c2eecc86aaf74dc4cec8286293 (patch)
tree10be23f5707a8e125ac73048ebc1e97f5569017c /src/cookie_helper.cc
parent6ba1725e0f731860f75e67d15e305f35dd0c3d67 (diff)
Return nullptr directly where std::unique_ptr is expected
The constructor of std::unique_ptr which takes nullptr is not explicit so we can return nullptr directly.
Diffstat (limited to 'src/cookie_helper.cc')
-rw-r--r--src/cookie_helper.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/cookie_helper.cc b/src/cookie_helper.cc
index 58a4c69c..388e223c 100644
--- a/src/cookie_helper.cc
+++ b/src/cookie_helper.cc
@@ -230,13 +230,13 @@ std::unique_ptr<Cookie> parse
std::string::const_iterator eq = cookieStr.begin();
for(; eq != nvEnd && *eq != '='; ++eq);
if(eq == nvEnd) {
- return std::unique_ptr<Cookie>{};
+ return nullptr;
}
std::pair<std::string::const_iterator,
std::string::const_iterator> p =
util::stripIter(cookieStr.begin(), eq);
if(p.first == p.second) {
- return std::unique_ptr<Cookie>{};
+ return nullptr;
}
Scip cookieName(p.first, p.second);
p = util::stripIter(eq+1, nvEnd);
@@ -275,18 +275,18 @@ std::unique_ptr<Cookie> parse
if(parseDate(expiryTime, attrp.first, attrp.second)) {
foundExpires = true;
} else {
- return std::unique_ptr<Cookie>{};
+ return nullptr;
}
} else if(util::strieq(p.first, p.second, "max-age")) {
if(attrp.first == attrp.second ||
(!in(static_cast<unsigned char>(*attrp.first), 0x30u, 0x39u) &&
*attrp.first != '-')) {
- return std::unique_ptr<Cookie>{};
+ return nullptr;
}
for(std::string::const_iterator s = attrp.first+1,
eos = attrp.second; s != eos; ++s) {
if(!in(static_cast<unsigned char>(*s), 0x30u, 0x39u)) {
- return std::unique_ptr<Cookie>{};
+ return nullptr;
}
}
int64_t delta;
@@ -305,17 +305,17 @@ std::unique_ptr<Cookie> parse
}
}
} else {
- return std::unique_ptr<Cookie>{};
+ return nullptr;
}
} else if(util::strieq(p.first, p.second, "domain")) {
if(attrp.first == attrp.second) {
- return std::unique_ptr<Cookie>{};
+ return nullptr;
}
std::string::const_iterator noDot = attrp.first;
std::string::const_iterator end = attrp.second;
for(; noDot != end && *noDot == '.'; ++noDot);
if(noDot == end) {
- return std::unique_ptr<Cookie>{};
+ return nullptr;
}
cookieDomain.assign(noDot, end);
} else if(util::strieq(p.first, p.second, "path")) {
@@ -348,7 +348,7 @@ std::unique_ptr<Cookie> parse
} else if(domainMatch(canonicalizedHost, cookieDomain)) {
hostOnly = util::isNumericHost(canonicalizedHost);
} else {
- return std::unique_ptr<Cookie>{};
+ return nullptr;
}
if(cookiePath.empty()) {