Skip to content

Commit 6359701

Browse files
Update kotlin to v2.4.0 (#1160)
1 parent 6f7d831 commit 6359701

3 files changed

Lines changed: 38 additions & 7 deletions

File tree

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ atomicfu = "0.33.0"
55
coroutines = "1.11.0"
66
jna = "5.18.1"
77
jvm-toolchain = "17"
8-
kotlin = "2.3.21"
8+
kotlin = "2.4.0"
99
tuulbox = "8.1.0"
1010

1111
[libraries]

kable-core/src/androidMain/kotlin/BluetoothLeScannerAndroidScanner.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ internal class BluetoothLeScannerAndroidScanner(
7575
}
7676

7777
override fun onBatchScanResults(results: MutableList<ScanResult>) {
78-
results.forEach(::sendResult)
78+
// for-each loop to avoid accidental use of java.lang.Iterable.forEach which
79+
// requires API 24.
80+
for (result in results) {
81+
sendResult(result)
82+
}
7983
}
8084

8185
override fun onScanFailed(errorCode: Int) {
@@ -153,7 +157,8 @@ internal fun List<FilterPredicate>.toScanFilters(): ScanFilters =
153157
} else if (count() == 1) {
154158
val nativeFilters = mutableMapOf<KClass<*>, Filter>()
155159
val flowFilters = mutableListOf<Filter>()
156-
single().filters.forEach { filter ->
160+
// for-each loop to avoid accidental use of java.lang.Iterable.forEach which requires API 24.
161+
for (filter in single().filters) {
157162
if (filter.canFilterNatively && filter::class !in nativeFilters) {
158163
nativeFilters[filter::class] = filter
159164
} else {
@@ -179,7 +184,8 @@ private val FilterPredicate.supportsNativeScanFiltering: Boolean
179184
var address = 0
180185
var manufacturerData = 0
181186
var serviceData = 0
182-
filters.forEach { filter ->
187+
// for-each loop to avoid accidental use of java.lang.Iterable.forEach which requires API 24.
188+
for (filter in filters) {
183189
when (filter) {
184190
is Service -> if (++service > 1) return false
185191
is Name.Exact -> if (++nameExact > 1) return false

kotlin-js-store/yarn.lock

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,7 +1766,16 @@ streamroller@^3.1.2:
17661766
debug "^4.3.4"
17671767
fs-extra "^8.1.0"
17681768

1769-
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
1769+
"string-width-cjs@npm:string-width@^4.2.0":
1770+
version "4.2.3"
1771+
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
1772+
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
1773+
dependencies:
1774+
emoji-regex "^8.0.0"
1775+
is-fullwidth-code-point "^3.0.0"
1776+
strip-ansi "^6.0.1"
1777+
1778+
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
17701779
version "4.2.3"
17711780
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
17721781
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@@ -1784,7 +1793,14 @@ string-width@^5.0.1, string-width@^5.1.2:
17841793
emoji-regex "^9.2.2"
17851794
strip-ansi "^7.0.1"
17861795

1787-
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
1796+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
1797+
version "6.0.1"
1798+
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
1799+
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
1800+
dependencies:
1801+
ansi-regex "^5.0.1"
1802+
1803+
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
17881804
version "6.0.1"
17891805
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
17901806
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@@ -2021,7 +2037,16 @@ workerpool@^9.2.0:
20212037
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-9.3.3.tgz#e75281fe62e851afb21cdeef8fa85f6a62ec3583"
20222038
integrity sha512-slxCaKbYjEdFT/o2rH9xS1hf4uRDch1w7Uo+apxhZ+sf/1d9e0ZVkn42kPNGP2dgjIx6YFvSevj0zHvbWe2jdw==
20232039

2024-
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
2040+
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
2041+
version "7.0.0"
2042+
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
2043+
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
2044+
dependencies:
2045+
ansi-styles "^4.0.0"
2046+
string-width "^4.1.0"
2047+
strip-ansi "^6.0.0"
2048+
2049+
wrap-ansi@^7.0.0:
20252050
version "7.0.0"
20262051
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
20272052
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==

0 commit comments

Comments
 (0)