From 8b869162fa372b19087b6d99d47c6543335c636e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ska=C5=82ka?= Date: Wed, 18 Dec 2024 14:09:28 +0100 Subject: [PATCH] Skip 0 length ranges when splitting --- .../java/com/expensify/livemarkdown/RangeSplitter.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/expensify/livemarkdown/RangeSplitter.java b/android/src/main/java/com/expensify/livemarkdown/RangeSplitter.java index 9212bbfd..10e9793c 100644 --- a/android/src/main/java/com/expensify/livemarkdown/RangeSplitter.java +++ b/android/src/main/java/com/expensify/livemarkdown/RangeSplitter.java @@ -2,11 +2,14 @@ import androidx.annotation.NonNull; +import com.facebook.systrace.Systrace; + import java.util.ArrayList; import java.util.List; public class RangeSplitter { public static ArrayList splitRangesOnEmojis(@NonNull List markdownRanges, @NonNull String type) { + Systrace.beginSection(0, "splitRangesOnEmojis"); ArrayList emojiRanges = new ArrayList<>(); ArrayList oldRanges = new ArrayList<>(markdownRanges); ArrayList newRanges = new ArrayList<>(); @@ -41,13 +44,16 @@ public static ArrayList splitRangesOnEmojis(@NonNull List 0) { + newRanges.add(newRange); + } } j += 1; } newRanges.add(currentRange); i += 1; } + Systrace.endSection(0); return newRanges; } }