Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for binarySearch (0.07 sec)

  1. okhttp/src/jvmTest/kotlin/okhttp3/internal/idn/IdnaMappingTableTest.kt

        assertEquals(4, binarySearch(0, 5) { index -> 9.compareTo(table[index]) })
    
        // Search for misses.
        assertEquals(-1, binarySearch(0, 5) { index -> 0.compareTo(table[index]) })
        assertEquals(-2, binarySearch(0, 5) { index -> 2.compareTo(table[index]) })
        assertEquals(-3, binarySearch(0, 5) { index -> 4.compareTo(table[index]) })
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Dec 27 13:39:56 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  2. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/publicsuffix/PublicSuffixDatabase.kt

        // will look like: [foo, bar, com], [bar, com], [com]. The longest matching rule wins.
        var exactMatch: String? = null
        for (i in domainLabelsUtf8Bytes.indices) {
          val rule = publicSuffixList.bytes.binarySearch(domainLabelsUtf8Bytes, i)
          if (rule != null) {
            exactMatch = rule
            break
          }
        }
    
        // In theory, wildcard rules are not restricted to having the wildcard in the leftmost position.
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jul 28 07:33:49 UTC 2025
    - 8.5K bytes
    - Viewed (0)
  3. okhttp/src/commonJvmAndroid/kotlin/okhttp3/internal/idn/IdnaMappingTable.kt

        val target = (codePoint and 0x1fff80) shr 7
        val offset =
          binarySearch(
            position = 0,
            limit = sections.length / 4,
          ) { index ->
            val entryIndex = index * 4
            val b0b1 = sections.read14BitInt(entryIndex)
            return@binarySearch target.compareTo(b0b1)
          }
    
        return when {
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Fri Dec 27 13:39:56 UTC 2024
    - 9K bytes
    - Viewed (0)
  4. android/guava-tests/test/com/google/common/collect/SortedListsTest.java

            for (int key = 0; key <= 10; key++) {
              assertModelAgrees(
                  LIST_WITHOUT_DUPS,
                  key,
                  SortedLists.binarySearch(LIST_WITHOUT_DUPS, key, presentBehavior, absentBehavior),
                  presentBehavior,
                  absentBehavior);
            }
          }
        }
      }
    
      public void testWithDups() {
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Aug 07 16:05:33 UTC 2025
    - 4K bytes
    - Viewed (0)
  5. okhttp-idna-mapping-table/src/main/kotlin/okhttp3/internal/idn/SimpleIdnaMappingTable.kt

      /**
       * Returns true if the [codePoint] was applied successfully. Returns false if it was disallowed.
       */
      fun map(
        codePoint: Int,
        sink: BufferedSink,
      ): Boolean {
        val index =
          mappings.binarySearch {
            when {
              it.sourceCodePoint1 < codePoint -> -1
              it.sourceCodePoint0 > codePoint -> 1
              else -> 0
            }
          }
    
        // Code points must be in 0..0x10ffff.
    Registered: Fri Sep 05 11:42:10 UTC 2025
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 6.8K bytes
    - Viewed (0)
Back to top