Skip to content

Update scalafmt-core to 3.9.8 #214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Scala Steward: Reformat with scalafmt 3.9.8
20454a804ba3477ad2f7c8c5df324b1fc349deed
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Version https://scalameta.org/scalafmt/docs/configuration.html#version
version = 3.7.17
version = 3.9.8
# Dialect https://scalameta.org/scalafmt/docs/configuration.html#scala-dialects
runner.dialect = scala213source3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ object Queue {
*/
private def buildPrint[U >: T](separator: String)(l: List[U])(t: List[U]): String = t match {
case Nil => l.mkString("Queue(", separator, ")")
case _ => {
case _ => {
if (l.nonEmpty)
l.mkString("Queue(", separator, separator) + t.mkString("", separator, ")")
else t.mkString("Queue(", separator, ")")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ object ImmutableSelection extends Selection[List, Int] {
if (idx < 0 || list.size <= idx) return None

list match {
case Nil => None
case Nil => None
case pivot :: rest => {
val (smaller, larger) = rest.partition(_ <= pivot)
val pivotIdx = smaller.size

idx.compare(pivotIdx) match {
case needleInSmaller if needleInSmaller < 0 =>
quickSelect(smaller, idx)
case needleIsPivot if needleIsPivot == 0 => Some(pivot)
case needleIsPivot if needleIsPivot == 0 => Some(pivot)
case needleInLarger if needleInLarger > 0 =>
quickSelect(larger, idx - pivotIdx - 1)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ object ImmutableSorting extends Sorting[List, Int] {
*/
def bubbleSort(xs: List[Int]): List[Int] = {
def bubbled(list: List[Int]): (List[Int], Boolean) = list match {
case Nil => (Nil, false)
case Nil => (Nil, false)
case elem :: rest =>
rest match {
case Nil => (elem :: Nil, false)
case Nil => (elem :: Nil, false)
case secondElem :: _ if elem <= secondElem => {
val (restBubbled, swapped) = bubbled(rest)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ import scala.annotation.tailrec
* Xoeseko
*/
def radixSort(xs: Array[Int], base: Int = 10): Array[Int] = {
var array = xs
var array = xs
def listToBuckets(arr: Array[Int], b: Int, it: Int): Array[Array[Int]] = {
val buckets = Array.ofDim[ArrayBuffer[Int]](base)
// Initialize buckets
Expand Down
Loading