File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -338,7 +338,7 @@ let diff_op operation a b =
338338 {operation; hunks; mine_no_nl; their_no_nl}
339339 in
340340 match l1, l2 with
341- | [] , [] | [" " ], [" " ] when mine = [] && their = [] -> None
341+ | [] , [] | [" " ], [" " ] when mine = [] && their = [] -> assert false
342342 | [] , [] -> Some (create_diff ~mine_no_nl: true ~their_no_nl: true )
343343 | [" " ], [] -> Some (create_diff ~mine_no_nl: false ~their_no_nl: true )
344344 | [] , [" " ] -> Some (create_diff ~mine_no_nl: true ~their_no_nl: false )
@@ -373,4 +373,5 @@ let diff operation a b = match a, b with
373373 | None , None -> invalid_arg " no input given"
374374 | None , Some b -> diff_op operation " " b
375375 | Some a , None -> diff_op operation a " "
376+ | Some a , Some b when String. equal a b -> None (* NOTE: Optimization *)
376377 | Some a , Some b -> diff_op operation a b
You can’t perform that action at this time.
0 commit comments