-
Notifications
You must be signed in to change notification settings - Fork 118
Backport kxDT-as-KUP infrastructure and migration changes #560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
9dcac5a
f92d697
311cba9
c468219
25e85b0
ab41ad1
4d0e348
8efcd34
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,9 @@ internal fun readTzFile(data: ByteArray): TzFile { | |
override fun toString(): String = "Ttinfo(utoff=$utoff, isdst=$isdst, abbrind=$abbrind)" | ||
} | ||
|
||
fun abbreviationForIndex(abbreviations: List<Byte>, startIndex: UByte): String = abbreviations.drop(startIndex.toInt()) | ||
.takeWhile { byte -> byte != 0.toByte() }.toByteArray().decodeToString() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The commit message says that this change was introduced because of https://youtrack.jetbrains.com/issue/KT-77986/, but I don't see the connection. This is just a function, not a local class. Could you please elaborate? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIU, the KT-77986 fix addressed a more general problem of the compiler not running relevant checks in nested local scopes (regardless of whether the subject is a class or a function), and this function was previously located in a local function inside a local function. I see that we have a slightly more applicable ticket (created precisely as a result of this kxDT-as-KUP hit), though: https://youtrack.jetbrains.com/issue/KT-78976/, – so I can link it instead. |
||
|
||
inline fun BinaryDataReader.readData(header: Header, readTime: () -> Long): TzFileData { | ||
val transitionTimes = List(header.timecnt) { readTime() } | ||
val transitionTypes = List(header.timecnt) { readByte() } | ||
|
@@ -99,8 +102,6 @@ internal fun readTzFile(data: ByteArray): TzFile { | |
) | ||
} | ||
val abbreviations = List(header.charcnt) { readByte() } | ||
fun abbreviationForIndex(startIndex: UByte): String = abbreviations.drop(startIndex.toInt()) | ||
.takeWhile { byte -> byte != 0.toByte() }.toByteArray().decodeToString() | ||
val leapSecondRules = List(header.leapcnt) { | ||
TzFileData.LeapSecondRule( | ||
readTime(), | ||
|
@@ -114,7 +115,7 @@ internal fun readTzFile(data: ByteArray): TzFile { | |
return TzFileData( | ||
leapSecondRules, | ||
transitionTimes.zip(transitionTypes) { time, type -> TzFileData.Transition(time, type.toInt()) }, | ||
ttinfos.map { TzFileData.ClockState(TzFileOffset(it.utoff), it.isdst, abbreviationForIndex(it.abbrind)) } | ||
ttinfos.map { TzFileData.ClockState(TzFileOffset(it.utoff), it.isdst, abbreviationForIndex(abbreviations, it.abbrind)) } | ||
) | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionSha256Sum=ff7bf6a86f09b9b2c40bb8f48b25fc19cf2b2664fd1d220cd7ab833ec758d0d7 | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip | ||
distributionSha256Sum=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026 | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the purpose of this line? https://docs.gradle.org/current/dsl/org.gradle.api.tasks.wrapper.Wrapper.html#org.gradle.api.tasks.wrapper.Wrapper:validateDistributionUrl says it's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIR, this line was added automatically by |
||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move the
import
below the copyright header so that it stays a header.