Skip to content

Commit ad634f3

Browse files
committed
Upgrade to Scala 3.4.1
1 parent 9fd00e9 commit ad634f3

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ jobs:
88
fail-fast: false
99
matrix:
1010
name: [ "test" ]
11-
scala: [ 3.3.0, 3.3.1 ]
11+
scala: [ 3.3.0, 3.4.1 ]
1212
java: [ 20, 21 ]
1313
include:
1414
- name: "format"
15-
scala: 3.3.1
15+
scala: 3.4.1
1616
java: 21
1717
exclude:
1818
- name: "test"

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
lazy val supportedScalaVersions = List("3.3.1", "3.3.0")
1+
lazy val supportedScalaVersions = List("3.4.1", "3.3.0")
22

33
lazy val root = project
44
.in(file("."))

src/main/scala/io/github/acl4s/ModInt.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ object Modulus {
9090
inline def apply[T <: Int](): Modulus[T] = Mod(compiletime.constValue[T])
9191
}
9292

93-
final case class StaticModInt[T <: Int] private (private[this] var _value: Int)(using m: Modulus[T])
94-
extends ModIntBase[T] {
93+
final case class StaticModInt[T <: Int] private (private var _value: Int)(using m: Modulus[T]) extends ModIntBase[T] {
9594
override type Self = StaticModInt[T]
9695
override val mod: T = m.value
9796

@@ -204,7 +203,7 @@ object ModInt998244353 {
204203
def apply(value: Long): ModInt998244353 = StaticModInt(value)
205204
}
206205

207-
final case class DynamicModInt private (private[this] var _value: Int) extends ModIntBase[Int] {
206+
final case class DynamicModInt private (private var _value: Int) extends ModIntBase[Int] {
208207
override type Self = DynamicModInt
209208
override val mod: Int = DynamicModInt.bt.m
210209

src/main/scala/io/github/acl4s/TwoSAT.scala

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package io.github.acl4s
22

3+
import scala.util.boundary, boundary.break
4+
35
/**
46
* Reference:
57
* B. Aspvall, M. Plass, and R. Tarjan,
@@ -28,12 +30,12 @@ class TwoSAT(private val n: Int) {
2830

2931
def satisfiable(): Boolean = {
3032
val (_, id) = scc.sccIds()
31-
(0 until n).foreach(i => {
32-
if (id(2 * i) == id(2 * i + 1)) {
33-
return false
33+
boundary {
34+
for (i <- 0 until n) {
35+
if (id(2 * i) == id(2 * i + 1)) { break(false) }
36+
answer(i) = id(2 * i) < id(2 * i + 1)
3437
}
35-
answer(i) = id(2 * i) < id(2 * i + 1)
36-
})
37-
true
38+
true
39+
}
3840
}
3941
}

0 commit comments

Comments
 (0)