From 43c32372e7bd3e02edce0b4c2064a2a59e2b2166 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 22 Jun 2020 22:48:03 +0200 Subject: [PATCH] util/UriUtil: make `schemes` array static --- src/util/UriUtil.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/util/UriUtil.cxx b/src/util/UriUtil.cxx index d8eee469c..c9100f4c0 100644 --- a/src/util/UriUtil.cxx +++ b/src/util/UriUtil.cxx @@ -167,7 +167,11 @@ gcc_pure static const char * SkipUriScheme(const char *uri) noexcept { - const char *const schemes[] = { "http://", "https://", "ftp://" }; + static const char *const schemes[] = { + "http://", "https://", + "ftp://", + }; + for (auto scheme : schemes) { auto result = StringAfterPrefixCaseASCII(uri, scheme); if (result != nullptr)