From 324880974bc52c78b9c6d8addc5fb7ea7ce24c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= Date: Sun, 21 Apr 2024 20:58:18 +0100 Subject: [PATCH] Xapi_events: replace List.any+map with List.exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Edwin Török --- ocaml/xapi/xapi_event.ml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ocaml/xapi/xapi_event.ml b/ocaml/xapi/xapi_event.ml index 49bfd673c53..ca7eee6df49 100644 --- a/ocaml/xapi/xapi_event.ml +++ b/ocaml/xapi/xapi_event.ml @@ -73,8 +73,6 @@ module Subscription = struct (Api_errors.event_subscription_parse_failure, [x]) ) - let any = List.fold_left (fun acc x -> acc || x) false - (** [table_matches subs tbl]: true if at least one subscription from [subs] would select some events from [tbl] *) let table_matches subs tbl = let tbl = String.lowercase_ascii tbl in @@ -86,7 +84,7 @@ module Subscription = struct | Object (x, _) -> x = tbl in - any (List.map matches subs) + List.exists matches subs (** [event_matches subs ev]: true if at least one subscription from [subs] selects for specified class and object *) let object_matches subs ty _ref = @@ -99,7 +97,7 @@ module Subscription = struct | Object (x, y) -> x = tbl && y = _ref in - any (List.map matches subs) + List.exists matches subs (** [event_matches subs ev]: true if at least one subscription from [subs] selects for event [ev] *) let event_matches subs ev = object_matches subs ev.ty ev.reference