Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for highestOneBit (0.29 sec)

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

          }
        }
      }
    
      private static String mikeRepeat(String string, int count) {
        final 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: 2024-11-01 12:43
    - Last Modified: 2021-09-17 20:24
    - 3.3K bytes
    - Viewed (0)
  2. 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: 2024-11-01 12:43
    - Last Modified: 2024-10-18 20:24
    - 2.5K bytes
    - Viewed (0)
  3. 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: 2024-11-01 12:43
    - Last Modified: 2024-10-18 20:24
    - 2.5K bytes
    - Viewed (0)
  4. guava-tests/benchmark/com/google/common/base/StringsRepeatBenchmark.java

          }
        }
      }
    
      private static String mikeRepeat(String string, int count) {
        final 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: 2024-11-01 12:43
    - Last Modified: 2021-09-17 20:24
    - 3.3K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/collect/CompactHashing.java

      }
    
      /** Creates and returns a properly-sized array with the given number of buckets. */
      static Object createTable(int buckets) {
        if (buckets < 2
            || buckets > Ints.MAX_POWER_OF_TWO
            || Integer.highestOneBit(buckets) != buckets) {
          throw new IllegalArgumentException("must be power of 2 between 2^1 and 2^30: " + buckets);
        }
        if (buckets <= BYTE_MAX_SIZE) {
          return new byte[buckets];
    Registered: 2024-11-01 12:43
    - Last Modified: 2024-10-25 15:34
    - 7.1K bytes
    - Viewed (0)
  6. guava/src/com/google/common/collect/CompactHashing.java

      }
    
      /** Creates and returns a properly-sized array with the given number of buckets. */
      static Object createTable(int buckets) {
        if (buckets < 2
            || buckets > Ints.MAX_POWER_OF_TWO
            || Integer.highestOneBit(buckets) != buckets) {
          throw new IllegalArgumentException("must be power of 2 between 2^1 and 2^30: " + buckets);
        }
        if (buckets <= BYTE_MAX_SIZE) {
          return new byte[buckets];
    Registered: 2024-11-01 12:43
    - Last Modified: 2024-10-25 15:34
    - 7.1K bytes
    - Viewed (0)
  7. 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: 2024-11-01 12:43
    - Last Modified: 2021-06-01 22:07
    - 15K bytes
    - Viewed (0)
  8. android/guava/src/com/google/common/primitives/ImmutableLongArray.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: 2024-11-01 12:43
    - Last Modified: 2024-10-25 18:05
    - 22.3K bytes
    - Viewed (0)
  9. 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: 2024-11-01 12:43
    - Last Modified: 2024-10-25 18:05
    - 21.4K 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: 2024-11-01 12:43
    - Last Modified: 2024-08-12 16:59
    - 18.8K bytes
    - Viewed (0)
Back to top