more performant check

This commit is contained in:
Pilzinsel64
2025-01-28 08:27:09 +01:00
parent f17fea31e8
commit 43f7684074

View File

@@ -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;
}