We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
isStrictPrefix
1 parent 6b204ad commit 9aa5552Copy full SHA for 9aa5552
rascal-textmate-core/src/main/rascal/util/ListUtil.rsc
@@ -1,6 +1,8 @@
1
module util::ListUtil
2
3
import List;
4
+import util::Benchmark;
5
+import IO;
6
7
@synopsis{
8
Representation of a traversal direction along a list
@@ -30,4 +32,4 @@ list[&T] dupLast(list[&T] l) = reverse(dup(reverse(l))); // TODO: Optimize/avoid
30
32
}
31
33
34
bool isStrictPrefix(list[&T] l1, list[&T] l2)
- = size(l1) < size(l2) && !any(i <- [0..size(l1)], l1[i] != l2[i]);
35
+ = size(l1) < size(l2) && l1 == l2[..size(l2)];
0 commit comments