Skip to content

Commit

Permalink
Fix compatibility problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartek committed Feb 1, 2025
1 parent 44b076d commit b02647f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/data/NonEmptySeq.scala
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ final class NonEmptySeq[+A] private (val toSeq: Seq[A]) extends AnyVal with NonE
override def distinctBy[B](f: A => B)(implicit O: Order[B]): NonEmptySeq[A] = {
implicit val ord: Ordering[B] = O.toOrdering

if (toSeq.sizeIs == 1) this
if (toSeq.lengthCompare(1) == 0) this
else {
val bldr = Seq.newBuilder[A]
val seen = mutable.TreeSet.empty[B]
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/cats/data/NonEmptyVector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ final class NonEmptyVector[+A] private (val toVector: Vector[A])
override def distinctBy[B](f: A => B)(implicit O: Order[B]): NonEmptyVector[A] = {
implicit val ord: Ordering[B] = O.toOrdering

if (toVector.sizeIs == 1) this
if (toVector.lengthCompare(1) == 0) this
else {
val bldr = Vector.newBuilder[A]
val seen = mutable.TreeSet.empty[B]
Expand Down

0 comments on commit b02647f

Please sign in to comment.