Skip to content

Commit

Permalink
Add comment that Symbols are interned
Browse files Browse the repository at this point in the history
  • Loading branch information
durban committed Sep 28, 2016
1 parent d75186a commit 318e456
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion kernel/src/main/scala/cats/kernel/instances/symbol.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ trait SymbolInstances {
}

class SymbolOrder extends Order[Symbol] {
override def eqv(x: Symbol, y: Symbol): Boolean =

override def eqv(x: Symbol, y: Symbol): Boolean = {
// Symbols are interned
x eq y
}

def compare(x: Symbol, y: Symbol): Int =
if (x eq y) 0 else x.name compareTo y.name
}

0 comments on commit 318e456

Please sign in to comment.