Skip to content

Commit 79f611a

Browse files
committed
get rid of duplicate filter_map
1 parent c9a0d4a commit 79f611a

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

jscomp/syntax/src/res_core.ml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@ end
1717
let mkLoc startLoc endLoc =
1818
Location.{loc_start = startLoc; loc_end = endLoc; loc_ghost = false}
1919

20-
let filter_map (f : 'a -> 'b option) xs =
21-
let rec aux acc = function
22-
| [] -> List.rev acc
23-
| y :: ys -> (
24-
match f y with
25-
| None -> aux acc ys
26-
| Some z -> aux (z :: acc) ys)
27-
in
28-
aux [] xs
29-
3020
module Recover = struct
3121
let defaultExpr () =
3222
let id = Location.mknoloc "rescript.exprhole" in
@@ -2305,7 +2295,7 @@ and parseTemplateExpr ?(prefix = "js") p =
23052295
in
23062296
let parts = parseParts p in
23072297
let strings = List.map fst parts in
2308-
let values = filter_map snd parts in
2298+
let values = Ext_list.filter_map parts snd in
23092299
let endPos = p.Parser.endPos in
23102300

23112301
let genTaggedTemplateCall () =

0 commit comments

Comments
 (0)