Skip to content

Commit c540938

Browse files
committed
Minor code improvements for IntegralRange and IntegralRangeTest.
1 parent 550229e commit c540938

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

subprojects/user-defined-integrals-in-kotlin/src/main/kotlin/org/sdkotlin/integral/IntegralRange.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class IntegralRange<I : Integral<I>>(
2222
}
2323

2424
override fun contains(value: I): Boolean =
25-
start <= value && value <= endInclusive
25+
value in start..endInclusive
2626

2727
override fun isEmpty(): Boolean = start > endInclusive
2828

subprojects/user-defined-integrals-in-kotlin/src/test/kotlin/org/sdkotlin/integral/IntegralRangeTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class IntegralRangeTest {
1010
fun `test equals, hashCode, and toString`() {
1111

1212
EqualsVerifier.forClass(IntegralRange::class.java)
13-
.withIgnoredFields("endExclusive\$delegate", "$\$delegate_0")
13+
.withIgnoredFields($$"endExclusive$delegate", $$$"$$delegate_0")
1414
// Required per https://github.com/jqno/equalsverifier/issues/1082.
1515
.withPrefabValues(
1616
Integral::class.java,
@@ -30,7 +30,7 @@ class IntegralRangeTest {
3030
val blue: ClosedRange<SignedIntegral> = one..two
3131

3232
EqualsVerifier.forExamples(red, blue)
33-
.withIgnoredFields("endExclusive\$delegate", "$\$delegate_0")
33+
.withIgnoredFields($$"endExclusive$delegate", $$$"$$delegate_0")
3434
.verify()
3535
}
3636
}

0 commit comments

Comments
 (0)