0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-01 19:22:53 +01:00

ircd:Ⓜ️🆔 Minor cleanup.

This commit is contained in:
Jason Volk 2018-03-13 23:33:37 -07:00
parent 0ffa3b6257
commit 44caf92dd7

View file

@ -280,9 +280,8 @@ const try
}; };
string_view out; string_view out;
const char *start{id.data()}; const char *start{id.begin()};
const char *const stop{id.data() + id.size()}; qi::parse(start, id.end(), eps > view_mxid, out);
qi::parse(start, stop, eps > view_mxid, out);
return out; return out;
} }
catch(const qi::expectation_failure<const char *> &e) catch(const qi::expectation_failure<const char *> &e)
@ -300,9 +299,8 @@ const try
}; };
string_view out; string_view out;
const char *start{id.data()}; const char *start{id.begin()};
const char *const stop{id.data() + id.size()}; qi::parse(start, id.end(), eps > view_mxid, out);
qi::parse(start, stop, eps > view_mxid, out);
return out; return out;
} }
catch(const qi::expectation_failure<const char *> &e) catch(const qi::expectation_failure<const char *> &e)
@ -322,9 +320,8 @@ void
ircd::m::id::validator::operator()(const string_view &id) ircd::m::id::validator::operator()(const string_view &id)
const try const try
{ {
const char *start{id.data()}; const char *start{id.begin()};
const char *const stop{id.data() + id.size()}; qi::parse(start, id.end(), eps > mxid);
qi::parse(start, stop, eps > mxid);
} }
catch(const qi::expectation_failure<const char *> &e) catch(const qi::expectation_failure<const char *> &e)
{ {
@ -341,9 +338,8 @@ const try
&lit(char(sigil)) > mxid &lit(char(sigil)) > mxid
}; };
const char *start{id.data()}; const char *start{id.begin()};
const char *const stop{id.data() + id.size()}; qi::parse(start, id.end(), eps > valid_mxid);
qi::parse(start, stop, eps > valid_mxid);
} }
catch(const qi::expectation_failure<const char *> &e) catch(const qi::expectation_failure<const char *> &e)
{ {
@ -535,10 +531,10 @@ const
}; };
uint16_t ret{8448}; uint16_t ret{8448};
auto *start{data()}; auto *start{begin()};
const auto res const auto res
{ {
qi::parse(start, data() + size(), rule, ret) qi::parse(start, end(), rule, ret)
}; };
assert(res || ret == 8448); assert(res || ret == 8448);
@ -560,10 +556,10 @@ const
}; };
string_view ret; string_view ret;
auto *start{data()}; auto *start{begin()};
const auto res const auto res
{ {
qi::parse(start, data() + size(), rule, ret) qi::parse(start, end(), rule, ret)
}; };
assert(res == true); assert(res == true);
@ -596,10 +592,10 @@ const
}; };
string_view ret; string_view ret;
auto *start{data()}; auto *start{begin()};
const auto res const auto res
{ {
qi::parse(start, data() + size(), rule, ret) qi::parse(start, end(), rule, ret)
}; };
assert(res == true); assert(res == true);
@ -622,8 +618,8 @@ const
}; };
string_view ret; string_view ret;
auto *start{data()}; auto *start{begin()};
qi::parse(start, data() + size(), rule, ret); qi::parse(start, end(), rule, ret);
assert(!ret.empty()); assert(!ret.empty());
return ret; return ret;
} }
@ -665,7 +661,7 @@ noexcept try
}; };
const char *start{begin(id)}; const char *start{begin(id)};
const char *const stop{end(id)}; const char *const &stop{end(id)};
return id.at(0) == sigil && qi::parse(start, stop, test) && start == stop; return id.at(0) == sigil && qi::parse(start, stop, test) && start == stop;
} }
catch(...) catch(...)
@ -684,8 +680,7 @@ noexcept try
}; };
const char *start{begin(id)}; const char *start{begin(id)};
const char *const stop{end(id)}; return id.at(0) == sigil && qi::parse(start, end(id), test);
return id.at(0) == sigil && qi::parse(start, stop, test);
} }
catch(...) catch(...)
{ {