From 43f76840745920e13956ebd7c5e399a853be1410 Mon Sep 17 00:00:00 2001 From: Pilzinsel64 Date: Tue, 28 Jan 2025 08:27:09 +0100 Subject: [PATCH] more performant check --- Pilz.Net/Api/ApiServer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pilz.Net/Api/ApiServer.cs b/Pilz.Net/Api/ApiServer.cs index 0807e04..140ef1d 100644 --- a/Pilz.Net/Api/ApiServer.cs +++ b/Pilz.Net/Api/ApiServer.cs @@ -415,7 +415,7 @@ public class ApiServer(string apiUrl) : IApiServer handler = filtered.FirstOrDefault(handler => handler.Url.Equals(url, StringComparison.InvariantCultureIgnoreCase)); // Check if equals via RegEx - handler ??= filtered.Where(n => n.UseRegEx).FirstOrDefault(handler => handler.Url.Equals(url, StringComparison.InvariantCultureIgnoreCase)); + handler ??= filtered.FirstOrDefault(handler => handler.UseRegEx && handler.Url.Equals(url, StringComparison.InvariantCultureIgnoreCase)); return handler != null; }