Compile Url match regex once and not on every use

Needed for #2146.
This commit is contained in:
agnostic-apollo
2021-06-30 03:18:44 +05:00
parent 69bebb5916
commit 28b9f93d13
4 changed files with 107 additions and 91 deletions

View File

@@ -1,6 +1,6 @@
package com.termux.app;
import com.termux.shared.data.DataUtils;
import com.termux.shared.data.UrlUtils;
import org.junit.Assert;
import org.junit.Test;
@@ -13,7 +13,7 @@ public class TermuxActivityTest {
private void assertUrlsAre(String text, String... urls) {
LinkedHashSet<String> expected = new LinkedHashSet<>();
Collections.addAll(expected, urls);
Assert.assertEquals(expected, DataUtils.extractUrls(text));
Assert.assertEquals(expected, UrlUtils.extractUrls(text));
}
@Test