All Downloads are FREE. Search and download functionalities are using the official Maven repository.

zio.query.UtilsVersionSpecific.scala Maven / Gradle / Ivy

The newest version!
package zio.query

import scala.collection.mutable

private[query] object UtilsVersionSpecific {
  private final val DefaultLoadFactor = 0.75d

  def newHashMap[K, V](expectedNumElements: Int): mutable.HashMap[K, V] =
    new mutable.HashMap[K, V](sizeFor(expectedNumElements, DefaultLoadFactor), DefaultLoadFactor)

  private def sizeFor(nElements: Int, loadFactor: Double): Int =
    ((nElements + 1).toDouble / loadFactor).toInt
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy