Skip to content

Commit

Permalink
in kernelJVM
Browse files Browse the repository at this point in the history
  • Loading branch information
satorg committed Sep 18, 2022
1 parent 7dff902 commit 0f40b93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ package compat

private[kernel] class HashCompat {
// Adapted from scala.util.hashing.MurmurHash#productHash.
private[kernel] def product1HashWithPrefix(_1Hash: Int, prefix: String): Int = {
private[kernel] def product1HashWithPrefix(_1Hash: Int, @unused prefix: String): Int = {
import scala.util.hashing.MurmurHash3._
var h = productSeed
h = mix(h, _1Hash)
finalizeHash(h, 1)
}

// Adapted from scala.util.hashing.MurmurHash#productHash.
private[cats] def product2HashWithPrefix(_1Hash: Int, _2Hash: Int, prefix: String): Int = {
private[cats] def product2HashWithPrefix(_1Hash: Int, _2Hash: Int, @unused prefix: String): Int = {
import scala.util.hashing.MurmurHash3._
var h = productSeed
h = mix(h, _1Hash)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@
package cats.kernel
package instances

import cats.kernel.compat.scalaVersionSpecific._
import cats.kernel.compat.unused

import scala.collection.mutable
import compat.scalaVersionSpecific._

@suppressUnusedImportWarningForScalaVersionSpecific
trait MapInstances extends MapInstances1 {
implicit def catsKernelStdHashForMap[K: Hash, V: Hash]: Hash[Map[K, V]] =
implicit def catsKernelStdHashForMap[K, V](implicit @unused K: Hash[K], V: Hash[V]): Hash[Map[K, V]] =
new MapHash[K, V]

implicit def catsKernelStdCommutativeMonoidForMap[K, V: CommutativeSemigroup]: CommutativeMonoid[Map[K, V]] =
Expand Down

0 comments on commit 0f40b93

Please sign in to comment.