-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- rename: - rank_less_path -> rankless_path - z_in -> z_in_of_policy - z_out -> z_out_of_policy - route_pkt_opt -> route_pkt - remove pkt arg from route_pkt_aux - convert State to association list
- Loading branch information
1 parent
8971291
commit 8614930
Showing
6 changed files
with
45 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,14 @@ | ||
type t = (string, float) Hashtbl.t | ||
type t = (string * float) list | ||
|
||
exception UnboundKey of string | ||
|
||
let create size = Hashtbl.create size | ||
let clone = Hashtbl.copy | ||
let lookup_opt k t = Hashtbl.find_opt t k | ||
let empty = [] | ||
let rebind k v t = (k, v) :: t | ||
let rebind_all lst t = List.fold_left (fun t (k, v) -> rebind k v t) t lst | ||
let is_defined = List.mem_assoc | ||
let lookup_opt = List.assoc_opt | ||
|
||
let lookup k t = | ||
match lookup_opt k t with | ||
| Some v -> v | ||
| None -> raise (UnboundKey k) | ||
|
||
let rebind k v t = | ||
Hashtbl.remove t k; | ||
Hashtbl.add t k v; | ||
t | ||
|
||
let rebind_all lst t = List.fold_left (fun t (k, v) -> rebind k v t) t lst | ||
let isdefined mem t = Hashtbl.mem t mem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
type t | ||
|
||
val create : int -> t | ||
val clone : t -> t | ||
val lookup : string -> t -> float | ||
val lookup_opt : string -> t -> float option | ||
exception UnboundKey of string | ||
|
||
val empty : t | ||
val rebind : string -> float -> t -> t | ||
val rebind_all : (string * float) list -> t -> t | ||
val isdefined : string -> t -> bool | ||
val is_defined : string -> t -> bool | ||
val lookup : string -> t -> float | ||
val lookup_opt : string -> t -> float option |