From 5cc1fafd7793af9e55c4f66ac57afbf010771a4e Mon Sep 17 00:00:00 2001 From: inoas Date: Wed, 26 Oct 2022 16:29:00 +0200 Subject: remove unecessary conversion --- src/gleam_stdlib.erl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/gleam_stdlib.erl b/src/gleam_stdlib.erl index 04b73eb..690cc34 100644 --- a/src/gleam_stdlib.erl +++ b/src/gleam_stdlib.erl @@ -201,8 +201,7 @@ regex_split(Regex, String) -> re:split(String, Regex). regex_submatches(String, {Start, Length}) -> - Binary = unicode:characters_to_binary(String, unicode, unicode), - BinarySlice = binary:part(Binary, {Start, Length}), + BinarySlice = binary:part(String, {Start, Length}), case string:is_empty(binary_to_list(BinarySlice)) of true -> none; false -> {some, BinarySlice} -- cgit v1.2.3