return by braced init list

shorter

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2021-11-11 02:18:46 -08:00
parent e08c85ae2d
commit 250011f016
14 changed files with 22 additions and 22 deletions

View File

@@ -94,7 +94,7 @@ uri_remove_auth(const char *uri) noexcept
const char *auth = SkipUriScheme(uri);
if (auth == nullptr)
/* unrecognized URI */
return std::string();
return {};
const char *slash = std::strchr(auth, '/');
if (slash == nullptr)
@@ -103,7 +103,7 @@ uri_remove_auth(const char *uri) noexcept
const char *at = (const char *)std::memchr(auth, '@', slash - auth);
if (at == nullptr)
/* no auth info present, do nothing */
return std::string();
return {};
/* duplicate the full URI and then delete the auth
information */