From 5c68f2009935ce772c37a6b6a856524d2dee50ec Mon Sep 17 00:00:00 2001 From: Don Cross Date: Tue, 12 Apr 2022 20:37:26 -0400 Subject: [PATCH] Fixed Kotlin build error. A build error slipped through because both ebraminio and I were making changes to the Kotlin code at the same time. Just needed to reorder the parameters to a call to `search`. --- generate/template/astronomy.kt | 2 +- .../main/kotlin/io/github/cosinekitty/astronomy/astronomy.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generate/template/astronomy.kt b/generate/template/astronomy.kt index 6575d276..3ba35d09 100644 --- a/generate/template/astronomy.kt +++ b/generate/template/astronomy.kt @@ -1989,7 +1989,7 @@ internal fun peakMoonShadow(searchCenterTime: Time): ShadowInfo { val window = 0.03 // days before/after new moon to search for minimum shadow distance val t1 = searchCenterTime.addDays(-window) val t2 = searchCenterTime.addDays(+window) - val tx = search(moonShadowSlopeContext, t1, t2, 1.0) ?: + val tx = search(t1, t2, 1.0, moonShadowSlopeContext) ?: throw InternalError("Failed to find Moon peak shadow event.") return moonShadow(tx) } diff --git a/source/kotlin/src/main/kotlin/io/github/cosinekitty/astronomy/astronomy.kt b/source/kotlin/src/main/kotlin/io/github/cosinekitty/astronomy/astronomy.kt index 1a611fc1..776bf26f 100644 --- a/source/kotlin/src/main/kotlin/io/github/cosinekitty/astronomy/astronomy.kt +++ b/source/kotlin/src/main/kotlin/io/github/cosinekitty/astronomy/astronomy.kt @@ -1989,7 +1989,7 @@ internal fun peakMoonShadow(searchCenterTime: Time): ShadowInfo { val window = 0.03 // days before/after new moon to search for minimum shadow distance val t1 = searchCenterTime.addDays(-window) val t2 = searchCenterTime.addDays(+window) - val tx = search(moonShadowSlopeContext, t1, t2, 1.0) ?: + val tx = search(t1, t2, 1.0, moonShadowSlopeContext) ?: throw InternalError("Failed to find Moon peak shadow event.") return moonShadow(tx) }