Transpiled version (5471L) is out of date.
1 | static LS allPrefixesInNavigableSet(S s, NavigableSet<S> set) { |
2 | if (set == null || s == null) null; |
3 | new LS prefixes; |
4 | while licensed { |
5 | S key = set.floor(s); |
6 | if (key == null) break; // s is in front of whole set => no prefix in there |
7 | int n = lCommonPrefix(key, s); |
8 | if (n == l(key)) { |
9 | prefixes.add(key); // found a prefix! |
10 | --n; |
11 | } |
12 | s = takeFirst(s, n); // shorten and try again |
13 | } |
14 | ret prefixes; |
15 | } |
Began life as a copy of #1029748
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034780 |
Snippet name: | allPrefixesInNavigableSet [case sensitive] - untested |
Eternal ID of this version: | #1034780/3 |
Text MD5: | 699ce5f63cd92d25d2b8495448f2ae17 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-03-08 09:35:20 |
Source code size: | 450 bytes / 15 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 122 / 185 |
Version history: | 2 change(s) |
Referenced in: | [show references] |