Libraryless. Click here for Pure Java version (2537L/16K).
1 | sbool <A> subListEquals(L<A> l, L<A> pat, int i) { |
2 | if (i < 0) false; |
3 | int j = i+l(pat); |
4 | if (j > l(l)) false; |
5 | for (int k = i; k < j; k++) |
6 | if (!eq(l.get(k), pat.get(k-i))) |
7 | false; |
8 | true; |
9 | } |
10 | |
11 | sbool <A> subListEquals(L<A> l, int i, A... pat) { |
12 | ret subListEquals(l, asVirtualList(pat), i); |
13 | } |
Began life as a copy of #1022225
download show line numbers debug dex old transpilations
Travelled to 5 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt
No comments. add comment
Snippet ID: | #1030287 |
Snippet name: | subListEquals |
Eternal ID of this version: | #1030287/3 |
Text MD5: | e33e7979b7b82206fedbd3aead262b28 |
Transpilation MD5: | 89cc0c817c5e12b623aa6146944f253e |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-11-27 15:16:57 |
Source code size: | 316 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 144 / 215 |
Version history: | 2 change(s) |
Referenced in: | [show references] |