Procházet zdrojové kódy

removed false opt in Common.find_file

Aleksandr Kuzmenko před 5 roky
rodič
revize
7a0b575302
1 změnil soubory, kde provedl 1 přidání a 8 odebrání
  1. 1 8
      src/context/common.ml

+ 1 - 8
src/context/common.ml

@@ -955,14 +955,7 @@ let find_file ctx f =
 						*)
 						*)
 						if is_loading_core_api || is_platform_specific || not is_cached then begin
 						if is_loading_core_api || is_platform_specific || not is_cached then begin
 							let full_path = if dir = "." then file_own_name else dir ^ "/" ^ file_own_name in
 							let full_path = if dir = "." then file_own_name else dir ^ "/" ^ file_own_name in
-							(*
-								This check is here just to save one `Hashtbl.remove` operation.
-								According to Hashtbl doc `replace` is `remove + add`. And it's
-								already known if we need to `remove` because of `is_cached`
-							*)
-							if is_cached then
-								Hashtbl.remove ctx.file_lookup_cache representation;
-							Hashtbl.add ctx.file_lookup_cache representation (Some full_path);
+							Hashtbl.replace ctx.file_lookup_cache representation (Some full_path);
 							(* Check if this file is the one requested by `Common.find_file f` *)
 							(* Check if this file is the one requested by `Common.find_file f` *)
 							if normalize_dir_separator representation = normalized_f then
 							if normalize_dir_separator representation = normalized_f then
 								found := full_path;
 								found := full_path;