use structured binding declarations

Shorter.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2020-10-22 01:36:13 -07:00
committed by Max Kellermann
parent da642b2890
commit 44378b7dbe
14 changed files with 45 additions and 57 deletions

View File

@@ -138,13 +138,10 @@ Directory::LookupDirectory(std::string_view _uri) noexcept
Directory *d = this;
do {
auto s = uri.Split(PathTraitsUTF8::SEPARATOR);
if (s.first.empty())
auto [name, rest] = uri.Split(PathTraitsUTF8::SEPARATOR);
if (name.empty())
break;
const auto name = s.first;
const auto rest = s.second;
Directory *tmp = d->FindChild(name);
if (tmp == nullptr)
/* not found */