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

3
LINES

< > BotCompany Repo | #1035283 // indexOfInSortedArray - note: may return any negative value if not found (not always -1)

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (31L/1K).

static <A> int indexOfInSortedArray(A[] array, A a) {
  ret array == null ? -1 : Arrays.binarySearch(array, a);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035283
Snippet name: indexOfInSortedArray - note: may return any negative value if not found (not always -1)
Eternal ID of this version: #1035283/2
Text MD5: 6b23ac2ef70298b3d848bc09549589aa
Transpilation MD5: 82a0d22bb8c1650fe73a14ac84712cd3
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-28 22:58:37
Source code size: 115 bytes / 3 lines
Pitched / IR pitched: No / No
Views / Downloads: 136 / 192
Version history: 1 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)