Libraryless. Click here for Pure Java version (10032L/55K).
1 | static <A> L<A> takeLastFromIterator(int n, Iterator<A> it) { |
2 | SimpleCircularBuffer buf = new(n); |
3 | if (it != null) |
4 | while (it.hasNext()) |
5 | buf.add(it.next()); |
6 | ret buf.asList(); |
7 | } |
Began life as a copy of #1003099
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1036492 |
Snippet name: | takeLastFromIterator |
Eternal ID of this version: | #1036492/3 |
Text MD5: | 81217582bd275b3b800f68559134e8ca |
Transpilation MD5: | 366bb82b980137ff22f77d9589815a41 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-12-20 21:08:45 |
Source code size: | 195 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 189 / 226 |
Version history: | 2 change(s) |
Referenced in: | [show references] |