simplify some for-loops in xml_parse

This commit is contained in:
Arvid Norberg 2018-04-02 22:58:43 +02:00 committed by Arvid Norberg
parent 6e4edd74c8
commit 77102102d6
1 changed files with 5 additions and 5 deletions

View File

@ -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 != '\"'))
{