Replace Regex.match and matchAll usages

This commit is contained in:
Ilya Gorbunov
2015-11-07 15:30:44 +03:00
parent f06d521bfe
commit 0579f6c8bf
4 changed files with 6 additions and 6 deletions
@@ -171,7 +171,7 @@ public object TypeIntrinsics {
*/
private fun getFunctionTypeArity(jetType: KotlinType): Int {
val classFqName = getClassFqName(jetType) ?: return -1
val match = KOTLIN_FUNCTION_INTERFACE_REGEX.match(classFqName) ?: return -1
val match = KOTLIN_FUNCTION_INTERFACE_REGEX.find(classFqName) ?: return -1
return Integer.valueOf(match.groups[1]!!.value)
}
@@ -254,8 +254,8 @@ public object KotlinCompilerClient {
private fun String.extractPortFromRunFilename(digest: String): Int =
makeRunFilenameString(timestamp = "[0-9TZ:\\.\\+-]+", digest = digest, port = "(\\d+)", escapeSequence = "\\").toRegex()
.match(this)
makeRunFilenameString(timestamp = "[0-9TZ:\\.\\+-]+", digest = digest, port = "(\\d+)", escapeSequence = "\\").toRegex()
.find(this)
?.groups?.get(1)
?.value?.toInt()
?: 0
@@ -42,7 +42,7 @@ internal fun Sequence<String>.ifNotContainsSequence(patternsIter: Iterator<LineP
{ acc, line ->
when {
!acc.iter.isValid() -> return@fold acc
acc.iter.value.regex.match(line)?.let { acc.iter.value.matchCheck(it) } ?: false -> acc.nextLineAndPattern()
acc.iter.value.regex.find(line)?.let { acc.iter.value.matchCheck(it) } ?: false -> acc.nextLineAndPattern()
else -> acc.nextLine()
}
}