Skip to content

Commit abdac27

Browse files
committed
Modify split(String) usages within stdlib.
1 parent 6f7a4d8 commit abdac27

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libraries/stdlib/src/kotlin/dom/DomJVM.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public fun Node.previousElements(): List<Element> = previousSiblings().filterIsI
121121
public var Element.classSet: MutableSet<String>
122122
get() {
123123
val answer = LinkedHashSet<String>()
124-
val array = this.classes.split("""\s""")
124+
val array = this.classes.split("""\s""".toRegex())
125125
for (s in array) {
126126
if (s.length() > 0) {
127127
answer.add(s)

libraries/stdlib/src/kotlin/io/files/FilePathComponents.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public fun File.filePathComponents(): FilePathComponents {
9595
// Split not only by / or \, but also by //, ///, \\, \\\, etc.
9696
val list = if (rootName.length() > 0 && subPath.isEmpty()) listOf() else
9797
// Looks awful but we split just by /+ or \+ depending on OS
98-
subPath.split("""\Q${File.separatorChar}\E+""").toList().map { it -> File(it) }
98+
subPath.split("""\Q${File.separatorChar}\E+""".toRegex()).toList().map { it -> File(it) }
9999
return FilePathComponents(rootName, list)
100100
}
101101

0 commit comments

Comments
 (0)