Libraryless. Click here for Pure Java version (31L/1K).
1 | static <A> int indexOfInSortedArray(A[] array, A a) {
|
2 | ret array == null ? -1 : Arrays.binarySearch(array, a); |
3 | } |
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: | 387 / 484 |
| Version history: | 1 change(s) |
| Referenced in: | [show references] |