From 77102102d61197e44d7efeb6e0e7028cdc5e2ec6 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 2 Apr 2018 22:58:43 +0200 Subject: [PATCH] simplify some for-loops in xml_parse --- src/xml_parse.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/xml_parse.cpp b/src/xml_parse.cpp index d917bf8cc..866ebd770 100644 --- a/src/xml_parse.cpp +++ b/src/xml_parse.cpp @@ -40,12 +40,12 @@ namespace libtorrent TORRENT_EXTRA_EXPORT void xml_parse(char const* p, char const* end , boost::function callback) { - for(;p != end; ++p) + for (;p != end; ++p) { char const* start = p; int token; // look for tag start - for(; p != end && *p != '<'; ++p); + for (; p != end && *p != '<'; ++p); if (p != start) { @@ -144,11 +144,11 @@ namespace libtorrent char const* val_start = NULL; // find start of attribute name - for (; i != tag_end && is_space(*i); ++i); + while (i != tag_end && is_space(*i)) ++i; if (i == tag_end) break; start = i; // find end of attribute name - for (; i != tag_end && *i != '=' && !is_space(*i); ++i); + while (i != tag_end && *i != '=' && !is_space(*i)) ++i; const int name_len = i - start; // look for equality sign @@ -164,7 +164,7 @@ namespace libtorrent } ++i; - for (; i != tag_end && is_space(*i); ++i); + while (i != tag_end && is_space(*i)) ++i; // check for parse error (values must be quoted) if (i == tag_end || (*i != '\'' && *i != '\"')) {