From 43b3ef60f80ce42f072e661ba8ac01ef71dcc1a0 Mon Sep 17 00:00:00 2001 From: Nikos Gorogiannis Date: Thu, 20 Feb 2020 09:16:50 -0800 Subject: [PATCH] [db][procname] kill dead optional argument Summary: No callers use optional argument. Reviewed By: ezgicicek Differential Revision: D20002257 fbshipit-source-id: e377db4fd --- infer/src/IR/Procname.ml | 4 ++-- infer/src/IR/Procname.mli | 4 ++-- infer/src/base/DB.ml | 4 ++-- infer/src/base/DB.mli | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/infer/src/IR/Procname.ml b/infer/src/IR/Procname.ml index 28edea86a..ff151b24b 100644 --- a/infer/src/IR/Procname.ml +++ b/infer/src/IR/Procname.ml @@ -767,7 +767,7 @@ let get_qualifiers pname = (** Convert a proc name to a filename *) -let to_filename ?crc_only pname = +let to_filename pname = (* filenames for clang procs are REVERSED qualifiers with '#' as separator *) let pp_rev_qualified fmt pname = let rev_qualifiers = get_qualifiers pname |> QualifiedCppName.to_rev_list in @@ -785,7 +785,7 @@ let to_filename ?crc_only pname = | _ -> F.asprintf "%a" pp_unique_id pname in - Escape.escape_filename @@ DB.append_crc_cutoff ?crc_only proc_id + Escape.escape_filename @@ DB.append_crc_cutoff proc_id module SQLite = struct diff --git a/infer/src/IR/Procname.mli b/infer/src/IR/Procname.mli index 9998abdb7..dc42980f2 100644 --- a/infer/src/IR/Procname.mli +++ b/infer/src/IR/Procname.mli @@ -309,8 +309,8 @@ val pp_unique_id : F.formatter -> t -> unit val to_unique_id : t -> string (** Convert a proc name into a unique identifier. *) -val to_filename : ?crc_only:bool -> t -> string -(** Convert a proc name to a filename or only to its crc. *) +val to_filename : t -> string +(** Convert a proc name to a filename. *) val get_qualifiers : t -> QualifiedCppName.t (** get qualifiers of C/objc/C++ method/function *) diff --git a/infer/src/base/DB.ml b/infer/src/base/DB.ml index 3a29986ca..57eed2654 100644 --- a/infer/src/base/DB.ml +++ b/infer/src/base/DB.ml @@ -17,7 +17,7 @@ let cutoff_length = 100 let crc_token = '.' -let append_crc_cutoff ?(key = "") ?(crc_only = false) name = +let append_crc_cutoff ?(key = "") name = let name_up_to_cutoff = if String.length name <= cutoff_length then name else String.sub name ~pos:0 ~len:cutoff_length in @@ -25,7 +25,7 @@ let append_crc_cutoff ?(key = "") ?(crc_only = false) name = let name_for_crc = name ^ key in Utils.string_crc_hex32 name_for_crc in - if crc_only then crc_str else Printf.sprintf "%s%c%s" name_up_to_cutoff crc_token crc_str + Printf.sprintf "%s%c%s" name_up_to_cutoff crc_token crc_str let curr_source_file_encoding = `Enc_crc diff --git a/infer/src/base/DB.mli b/infer/src/base/DB.mli index f54d0de9c..89d4e8a60 100644 --- a/infer/src/base/DB.mli +++ b/infer/src/base/DB.mli @@ -55,9 +55,9 @@ module Results_dir : sig (** create a file at the given path, creating any missing directories *) end -val append_crc_cutoff : ?key:string -> ?crc_only:bool -> string -> string +val append_crc_cutoff : ?key:string -> string -> string (** Append a crc to the string, using string_crc_hex32. Cut the string if it exceeds the cutoff - limit. Use an optional key to compute the crc. Return only the crc if [crc_only] is true. *) + limit. Use an optional key to compute the crc. *) val source_file_encoding : SourceFile.t -> string (** string encoding of a source file (including path) as a single filename *)