From 521d3e0ef449caf78ad40392223dcd4399d4d34c Mon Sep 17 00:00:00 2001 From: Guillaume Petiot Date: Tue, 18 Feb 2020 15:52:09 +0700 Subject: [PATCH] simplify --- lib/Source.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Source.ml b/lib/Source.ml index 377dc02cd1..7aa632f3ab 100644 --- a/lib/Source.ml +++ b/lib/Source.ml @@ -37,14 +37,14 @@ let indentation_of_index t idx = match String.split_lines t with | [] -> None | lines -> - let rec aux wc_acc ln = function + let rec aux wc_acc = function | [] -> None | h :: t -> if idx < wc_acc + String.length h then Some (String.length h - String.(length (lstrip h))) - else aux (wc_acc + String.length h) (ln + 1) t + else aux (wc_acc + String.length h) t in - aux 0 1 lines + aux 0 lines let position_before t (pos : Lexing.position) = let is_closing c =