Skip to content

Commit

Permalink
[cleanup] simplify restoring packageheap
Browse files Browse the repository at this point in the history
Summary: DRY

Reviewed By: nmote

Differential Revision: D20647159

fbshipit-source-id: b483cd6659c686c320f5b906749ef4ae6b7b30a5
  • Loading branch information
mroch authored and facebook-github-bot committed Mar 25, 2020
1 parent 8247cb7 commit 675c89d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/services/inference/module/module_js.mli
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ val add_parsed_resolved_requires :
File_key.t ->
bool * Flow_error.ErrorSet.t

val add_package : string -> Loc.t Package_json.t_or_error -> unit
val add_package : string -> (Package_json.t, 'a) result -> unit

type package_incompatible_reason =
(* Didn't exist before, now it exists *)
Expand Down
4 changes: 1 addition & 3 deletions src/services/inference/types_js.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2575,9 +2575,7 @@ let init_from_saved_state ~profiling ~workers ~saved_state ~updates options =
(Printf.sprintf
"Saved state for `%s` missing Package_json.t data"
str)
| Some (Ok package) ->
Module_heaps.Package_heap_mutator.add_package_json str package
| Some (Error ()) -> Module_heaps.Package_heap_mutator.add_error str
| Some package -> Module_js.add_package str package
end
| _ -> ()
end;
Expand Down

0 comments on commit 675c89d

Please sign in to comment.