Skip to content

Commit

Permalink
Upgrade to Scala 3.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
harry0000 committed Apr 15, 2024
1 parent 9fd00e9 commit ad634f3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
fail-fast: false
matrix:
name: [ "test" ]
scala: [ 3.3.0, 3.3.1 ]
scala: [ 3.3.0, 3.4.1 ]
java: [ 20, 21 ]
include:
- name: "format"
scala: 3.3.1
scala: 3.4.1
java: 21
exclude:
- name: "test"
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
lazy val supportedScalaVersions = List("3.3.1", "3.3.0")
lazy val supportedScalaVersions = List("3.4.1", "3.3.0")

lazy val root = project
.in(file("."))
Expand Down
5 changes: 2 additions & 3 deletions src/main/scala/io/github/acl4s/ModInt.scala
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ object Modulus {
inline def apply[T <: Int](): Modulus[T] = Mod(compiletime.constValue[T])
}

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

Expand Down Expand Up @@ -204,7 +203,7 @@ object ModInt998244353 {
def apply(value: Long): ModInt998244353 = StaticModInt(value)
}

final case class DynamicModInt private (private[this] var _value: Int) extends ModIntBase[Int] {
final case class DynamicModInt private (private var _value: Int) extends ModIntBase[Int] {
override type Self = DynamicModInt
override val mod: Int = DynamicModInt.bt.m

Expand Down
14 changes: 8 additions & 6 deletions src/main/scala/io/github/acl4s/TwoSAT.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.github.acl4s

import scala.util.boundary, boundary.break

/**
* Reference:
* B. Aspvall, M. Plass, and R. Tarjan,
Expand Down Expand Up @@ -28,12 +30,12 @@ class TwoSAT(private val n: Int) {

def satisfiable(): Boolean = {
val (_, id) = scc.sccIds()
(0 until n).foreach(i => {
if (id(2 * i) == id(2 * i + 1)) {
return false
boundary {
for (i <- 0 until n) {
if (id(2 * i) == id(2 * i + 1)) { break(false) }
answer(i) = id(2 * i) < id(2 * i + 1)
}
answer(i) = id(2 * i) < id(2 * i + 1)
})
true
true
}
}
}

0 comments on commit ad634f3

Please sign in to comment.