From 1555ec455e3e23a4687f661d9389c21d11e806f7 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Sun, 23 Oct 2011 12:07:29 +0200 Subject: cppcheck (bzr r10695) --- src/dom/uri.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/dom/uri.cpp') diff --git a/src/dom/uri.cpp b/src/dom/uri.cpp index b8a9a04fb..6a34f1838 100644 --- a/src/dom/uri.cpp +++ b/src/dom/uri.cpp @@ -179,7 +179,7 @@ static DOMString toStr(const std::vector &arr) { DOMString buf; std::vector::const_iterator iter; - for (iter=arr.begin() ; iter!=arr.end() ; iter++) + for (iter=arr.begin() ; iter!=arr.end() ; ++iter) { int ch = *iter; if (isprint(ch)) @@ -503,13 +503,13 @@ void URI::normalize() else if (sequ(s, "..") && iter != segments.begin() && !sequ(*(iter-1), "..")) { - iter--; //back up, then erase two entries + --iter; //back up, then erase two entries iter = segments.erase(iter); iter = segments.erase(iter); edited = true; } else - iter++; + ++iter; } //## Rebuild path, if necessary @@ -521,7 +521,7 @@ void URI::normalize() path.push_back('/'); } std::vector< std::vector >::iterator iter; - for (iter=segments.begin() ; iter!=segments.end() ; iter++) + for (iter=segments.begin() ; iter!=segments.end() ; ++iter) { if (iter != segments.begin()) path.push_back('/'); @@ -920,7 +920,7 @@ bool URI::parse(const DOMString &str) DOMString::const_iterator iter; unsigned int i=0; - for (iter= str.begin() ; iter!=str.end() ; iter++) + for (iter= str.begin() ; iter!=str.end() ; ++iter) { int ch = *iter; if (ch == '\\') -- cgit v1.2.3 From 2633767789e4264b13ef91a684accf734fb4e94f Mon Sep 17 00:00:00 2001 From: "Jon A. Cruz" Date: Wed, 26 Oct 2011 21:55:51 -0700 Subject: Fixing more broken and split doc comments. (bzr r10697) --- src/dom/uri.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dom/uri.cpp') diff --git a/src/dom/uri.cpp b/src/dom/uri.cpp index 6a34f1838..d559dffeb 100644 --- a/src/dom/uri.cpp +++ b/src/dom/uri.cpp @@ -1,4 +1,4 @@ -/** +/* * Phoebe DOM Implementation. * * This is a C++ approximation of the W3C DOM model, which follows -- cgit v1.2.3 From 5e7d96110e0c4b19b7e1b05e949f70673358be05 Mon Sep 17 00:00:00 2001 From: Kris De Gussem Date: Mon, 7 Nov 2011 15:03:20 +0100 Subject: cppcheck: performance and initialisation (bzr r10729) --- src/dom/uri.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/dom/uri.cpp') diff --git a/src/dom/uri.cpp b/src/dom/uri.cpp index d559dffeb..e1089017d 100644 --- a/src/dom/uri.cpp +++ b/src/dom/uri.cpp @@ -144,6 +144,7 @@ void URI::init() scheme = SCHEME_NONE; schemeStr.clear(); port = 0; + portSpecified = false; authority.clear(); path.clear(); absolute = false; @@ -200,18 +201,18 @@ static DOMString toStr(const std::vector &arr) DOMString URI::toString() const { DOMString str = schemeStr; - if (authority.size() > 0) + if (!authority.empty()) { str.append("//"); str.append(toStr(authority)); } str.append(toStr(path)); - if (query.size() > 0) + if (!query.empty()) { str.append("?"); str.append(toStr(query)); } - if (fragment.size() > 0) + if (!fragment.empty()) { str.append("#"); str.append(toStr(fragment)); @@ -380,11 +381,11 @@ URI URI::resolve(const URI &other) const return other; //## 2 - if (other.fragment.size() > 0 && - other.path.size() == 0 && - other.scheme == SCHEME_NONE && - other.authority.size() == 0 && - other.query.size() == 0 ) + if (!other.fragment.empty() && + other.path.empty() && + other.scheme == SCHEME_NONE && + other.authority.empty() && + other.query.empty()) { URI fragUri = *this; fragUri.fragment = other.fragment; @@ -398,7 +399,7 @@ URI URI::resolve(const URI &other) const newUri.schemeStr = schemeStr; newUri.query = other.query; newUri.fragment = other.fragment; - if (other.authority.size() > 0) + if (!other.authority.empty()) { //# 3.2 if (absolute || other.absolute) -- cgit v1.2.3