Summary: - abstracted the type for a node key - moved it to its own module with an ugly `compute` to avoid cyclic dependencies... - renamed `node_id` to `node_id_key` where needed - moved key computation from `State` to `Procdesc.Node` Reviewed By: jvillard Differential Revision: D9332803 fbshipit-source-id: fe1ae8c1cmaster
parent
dd4ee55d5a
commit
919d05b5ef
@ -0,0 +1,19 @@
|
||||
(*
|
||||
* Copyright (c) 2018-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
|
||||
type t = Caml.Digest.t
|
||||
|
||||
let to_string = Caml.Digest.to_hex
|
||||
|
||||
let compute node ~simple_key ~succs ~preds =
|
||||
let v = (simple_key node, List.rev_map ~f:simple_key succs, List.rev_map ~f:simple_key preds) in
|
||||
Utils.better_hash v
|
||||
|
||||
|
||||
let of_frontend_node_key = Utils.better_hash
|
@ -0,0 +1,17 @@
|
||||
(*
|
||||
* Copyright (c) 2018-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
|
||||
type t
|
||||
|
||||
val to_string : t -> string
|
||||
|
||||
val compute :
|
||||
'node -> simple_key:('node -> 'simple_key) -> succs:'node list -> preds:'node list -> t
|
||||
|
||||
val of_frontend_node_key : string -> t
|
Loading…
Reference in new issue