From 9e802ad721d9b2594317c41cec354e3672994103 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max.kellermann@gmail.com>
Date: Tue, 12 Sep 2023 09:34:50 +0200
Subject: [PATCH] util/StringCompare: add `pure` attribute

---
 src/util/StringCompare.hxx | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/util/StringCompare.hxx b/src/util/StringCompare.hxx
index f08b32d6c..579752187 100644
--- a/src/util/StringCompare.hxx
+++ b/src/util/StringCompare.hxx
@@ -1,8 +1,7 @@
 // SPDX-License-Identifier: BSD-2-Clause
 // author: Max Kellermann <max.kellermann@gmail.com>
 
-#ifndef STRING_COMPARE_HXX
-#define STRING_COMPARE_HXX
+#pragma once
 
 #include "StringAPI.hxx"
 
@@ -12,7 +11,7 @@
 
 #include <string_view>
 
-[[gnu::nonnull]]
+[[gnu::pure]] [[gnu::nonnull]]
 static constexpr bool
 StringIsEmpty(const char *string) noexcept
 {
@@ -134,5 +133,3 @@ RemoveSuffix(std::basic_string_view<T> &haystack,
 		haystack.remove_suffix(needle.size());
 	return match;
 }
-
-#endif