simplify some for-loops in xml_parse
This commit is contained in:
parent
6e4edd74c8
commit
77102102d6
|
@ -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 != '\"'))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue