Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 17 for highestOneBit (0.1 sec)

  1. android/guava-tests/benchmark/com/google/common/base/StringsRepeatBenchmark.java

            throw new RuntimeException("Wrong length: " + x);
          }
        }
      }
    
      private static String mikeRepeat(String string, int count) {
        int len = string.length();
        char[] strCopy = new char[len * Integer.highestOneBit(count)];
        string.getChars(0, len, strCopy, 0);
    
        char[] array = new char[len * count];
    
        int strCopyLen = len;
        int pos = 0;
        while (count != 0) {
          if ((count & 1) != 0) {
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-05-13 18:46
    - 3.4K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/collect/Hashing.java

        // Get the recommended table size.
        // Round down to the nearest power of 2.
        expectedEntries = max(expectedEntries, 2);
        int tableSize = Integer.highestOneBit(expectedEntries);
        // Check to make sure that we will not exceed the maximum load factor.
        if (expectedEntries > (int) (loadFactor * tableSize)) {
          tableSize <<= 1;
    Registered: 2025-05-30 12:43
    - Last Modified: 2024-12-22 03:38
    - 2.5K bytes
    - Viewed (0)
  3. guava-tests/benchmark/com/google/common/base/StringsRepeatBenchmark.java

            throw new RuntimeException("Wrong length: " + x);
          }
        }
      }
    
      private static String mikeRepeat(String string, int count) {
        int len = string.length();
        char[] strCopy = new char[len * Integer.highestOneBit(count)];
        string.getChars(0, len, strCopy, 0);
    
        char[] array = new char[len * count];
    
        int strCopyLen = len;
        int pos = 0;
        while (count != 0) {
          if ((count & 1) != 0) {
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-05-13 18:46
    - 3.4K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/base/SmallCharMatcher.java

        if (setSize == 1) {
          return 2;
        }
        // Correct the size for open addressing to match desired load factor.
        // Round up to the next highest power of 2.
        int tableSize = Integer.highestOneBit(setSize - 1) << 1;
        while (tableSize * DESIRED_LOAD_FACTOR < setSize) {
          tableSize <<= 1;
        }
        return tableSize;
      }
    
      static CharMatcher from(BitSet chars, String description) {
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-02-12 03:49
    - 4.5K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/collect/ObjectCountHashMap.java

      }
    
      void ensureCapacity(int minCapacity) {
        if (minCapacity > entries.length) {
          resizeEntries(minCapacity);
        }
        if (minCapacity >= threshold) {
          int newTableSize = Math.max(2, Integer.highestOneBit(minCapacity - 1) << 1);
          resizeTable(newTableSize);
        }
      }
    
      @CanIgnoreReturnValue
      public int put(@ParametricNullness K key, int value) {
        checkPositive(value, "count");
    Registered: 2025-05-30 12:43
    - Last Modified: 2024-12-22 03:38
    - 15K bytes
    - Viewed (0)
  6. guava/src/com/google/common/primitives/ImmutableIntArray.java

          }
          // careful of overflow!
          int newCapacity = oldCapacity + (oldCapacity >> 1) + 1;
          if (newCapacity < minCapacity) {
            newCapacity = Integer.highestOneBit(minCapacity - 1) << 1;
          }
          if (newCapacity < 0) {
            newCapacity = Integer.MAX_VALUE; // guaranteed to be >= newCapacity
          }
          return newCapacity;
        }
    
        /**
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-04-14 16:36
    - 21.4K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/collect/ImmutableCollection.java

            return oldCapacity;
          }
          // careful of overflow!
          int newCapacity = oldCapacity + (oldCapacity >> 1) + 1;
          if (newCapacity < minCapacity) {
            newCapacity = Integer.highestOneBit(minCapacity - 1) << 1;
          }
          if (newCapacity < 0) {
            newCapacity = Integer.MAX_VALUE;
            // guaranteed to be >= newCapacity
          }
          return newCapacity;
        }
    
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-04-14 16:07
    - 21.4K bytes
    - Viewed (0)
  8. guava/src/com/google/common/base/Joiner.java

          return oldCapacity;
        }
        // careful of overflow!
        int newCapacity = oldCapacity + (oldCapacity >> 1) + 1;
        if (newCapacity < minCapacity) {
          newCapacity = Integer.highestOneBit(minCapacity - 1) << 1;
        }
        if (newCapacity < 0) {
          newCapacity = Integer.MAX_VALUE;
          // guaranteed to be >= newCapacity
        }
        return newCapacity;
      }
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-04-14 15:16
    - 21K bytes
    - Viewed (0)
  9. android/guava/src/com/google/common/base/Joiner.java

          return oldCapacity;
        }
        // careful of overflow!
        int newCapacity = oldCapacity + (oldCapacity >> 1) + 1;
        if (newCapacity < minCapacity) {
          newCapacity = Integer.highestOneBit(minCapacity - 1) << 1;
        }
        if (newCapacity < 0) {
          newCapacity = Integer.MAX_VALUE;
          // guaranteed to be >= newCapacity
        }
        return newCapacity;
      }
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-03-17 20:26
    - 19.3K bytes
    - Viewed (0)
  10. guava/src/com/google/common/collect/ImmutableCollection.java

            return oldCapacity;
          }
          // careful of overflow!
          int newCapacity = oldCapacity + (oldCapacity >> 1) + 1;
          if (newCapacity < minCapacity) {
            newCapacity = Integer.highestOneBit(minCapacity - 1) << 1;
          }
          if (newCapacity < 0) {
            newCapacity = Integer.MAX_VALUE;
            // guaranteed to be >= newCapacity
          }
          return newCapacity;
        }
    
    Registered: 2025-05-30 12:43
    - Last Modified: 2025-04-08 13:05
    - 18.7K bytes
    - Viewed (0)
Back to top