Skip to content
This repository was archived by the owner on Jan 20, 2023. It is now read-only.

Commit 6d5994f

Browse files
author
wrongwrong
committed
サイズ系処理はoverrideできていないとデバッガがエラーを吐くため修正
1 parent c1c6c1d commit 6d5994f

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/main/kotlin/com/mapk/fastkfunction/argumentbucket/ArgumentBucket.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.mapk.fastkfunction.argumentbucket
22

3-
import java.lang.UnsupportedOperationException
43
import kotlin.reflect.KParameter
54

65
class ArgumentBucket(
@@ -69,6 +68,7 @@ class ArgumentBucket(
6968
get() = keys.fold(HashSet()) { acc, cur ->
7069
acc.apply { if (initializationStatuses[cur.index]) add(cur) }
7170
}
71+
override val size: Int get() = initializationStatuses.count { it }
7272
override val values: Collection<Any?>
7373
get() = valueArray.filterIndexed { idx, _ -> initializationStatuses[idx] }
7474

@@ -82,8 +82,5 @@ class ArgumentBucket(
8282
override fun get(key: KParameter): Any? = valueArray[key.index]
8383
operator fun get(index: Int): Any? = valueArray[index]
8484

85-
// サイズ系の処理はVALUEパラメータ以外を考慮した際の整合性を考えることが難しく、使う場面も無いためUnsupported
86-
override val size: Int
87-
get() = throw UnsupportedOperationException()
88-
override fun isEmpty(): Boolean = throw UnsupportedOperationException()
85+
override fun isEmpty(): Boolean = size == 0
8986
}

0 commit comments

Comments
 (0)