Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

7
LINES

< > BotCompany Repo | #1027261 // takeFirst_cloneIfDifferent - take first, return new list unless list isn't cut at all

JavaX fragment (include)

static <A> L<A> takeFirst_cloneIfDifferent(L<A> l, int n) {
  ret l(l) <= n ? l : subList_cloneIfDifferent(l, 0, n);
}

static <A> L<A> takeFirst_cloneIfDifferent(int n, L<A> l) {
  ret takeFirst_cloneIfDifferent(l, n);
}

Author comment

Began life as a copy of #1025353

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1027261
Snippet name: takeFirst_cloneIfDifferent - take first, return new list unless list isn't cut at all
Eternal ID of this version: #1027261/1
Text MD5: 101fedd66908272d1914e9d1f93040ca
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-28 12:10:12
Source code size: 227 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 187 / 214
Referenced in: [show references]