From 02a3fa8f07e5bb99653fcf6211e39130c27c7a98 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Fri, 11 Jan 2008 09:58:41 +0000 Subject: [PATCH] cache for mtime of files is not polluted with None, minimal speedup --- helm/software/components/library/librarian.ml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/helm/software/components/library/librarian.ml b/helm/software/components/library/librarian.ml index f53de728c..bab6dd2bc 100644 --- a/helm/software/components/library/librarian.ml +++ b/helm/software/components/library/librarian.ml @@ -162,7 +162,9 @@ module Make = functor (F:Format) -> struct | Some _ as x -> x | None -> match F.mtime_of_target_object b with - | Some t as x -> Hashtbl.add ct b x; x + | Some t as x -> + Hashtbl.remove ct b; + Hashtbl.add ct b x; x | x -> x with Not_found -> assert false in @@ -178,7 +180,9 @@ module Make = functor (F:Format) -> struct | Some _ as x -> x | None -> match F.mtime_of_target_object a with - | Some t as x -> Hashtbl.add ct a x; x + | Some t as x -> + Hashtbl.remove ct b; + Hashtbl.add ct a x; x | x -> x with Not_found -> assert false in @@ -188,7 +192,9 @@ module Make = functor (F:Format) -> struct | Some _ as x -> x | None -> match F.mtime_of_target_object b with - | Some t as x -> Hashtbl.add ct b x; x + | Some t as x -> + Hashtbl.remove ct b; + Hashtbl.add ct b x; x | x -> x with Not_found -> assert false in -- 2.39.2