mirror of
https://github.com/digital-asset/daml.git
synced 2024-11-10 10:46:11 +03:00
use require for some argument checks instead of assert (#15646)
- suggested by @avdv in #15565; thanks
This commit is contained in:
parent
ba595c4ee7
commit
51c3865701
@ -546,7 +546,7 @@ object Queries {
|
||||
selector: Fragment,
|
||||
): Fragment =
|
||||
fr"CASE" ++ {
|
||||
assert(m.nonEmpty, "existing offsets must be non-empty")
|
||||
require(m.nonEmpty, "existing offsets must be non-empty")
|
||||
val when +: whens = m.iterator.map { case (k, v) =>
|
||||
fr"WHEN ($selector = $k) THEN $v"
|
||||
}.toVector
|
||||
@ -600,7 +600,7 @@ object Queries {
|
||||
size: Int,
|
||||
groups: NonEmpty[Map[K, NonEmpty[Set[V]]]],
|
||||
): NonEmpty[Map[K, NonEmpty[Vector[NonEmpty[Set[V]]]]]] = {
|
||||
assert(size > 0, s"chunk size must be positive, not $size")
|
||||
require(size > 0, s"chunk size must be positive, not $size")
|
||||
groups.transform { (_, nesv) =>
|
||||
nesv.grouped(size).collect { case NonEmpty(sv) => sv }.toVector match {
|
||||
case NonEmpty(svs) => svs
|
||||
|
Loading…
Reference in New Issue
Block a user