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

11
LINES

< > BotCompany Repo | #1011729 // fastIntern - VM-wide intern - faster alternative to String.intern()

JavaX fragment (include)

static Method fastIntern_method;

static S fastIntern(S s) ctex {
  if (s == null) null;
  if (fastIntern_method == null) {
    fastIntern_method = findMethodNamed(javax(), 'internPerProgram);
    if (fastIntern_method == null) upgradeJavaXAndRestart();
  }
    
  ret (S) fastIntern_method.invoke(null, s);
}

Author comment

Began life as a copy of #1011692

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1011729
Snippet name: fastIntern - VM-wide intern - faster alternative to String.intern()
Eternal ID of this version: #1011729/4
Text MD5: 139f5b91e8974262598dbe99f5fc4e77
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-03 17:30:07
Source code size: 319 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 425 / 455
Version history: 3 change(s)
Referenced in: [show references]