aboutsummaryrefslogtreecommitdiff
path: root/autofill-parser/src/main/java/mozilla
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-04-28 10:27:14 +0530
committerGitHub <noreply@github.com>2021-04-28 10:27:14 +0530
commit4880e1db276b4cf2ec29eeffbd38539ca643b4be (patch)
tree44d1a7948128e2f12b874167f8fe7db5df4e178f /autofill-parser/src/main/java/mozilla
parentd3bc28c1c38e51a642331973b10edfb49ec026b3 (diff)
Upgrade to Kotlin 1.5 (#1397)
* build: upgrade Kotlin to 1.5.0 and Hilt to 2.35.1 Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * all: address kotlin.time.seconds deprecation Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * autofill-parser/openpgp-ktx: require Kotlin 1.5 Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * all: address string method deprecations Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> * build: disable NewApi lint Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'autofill-parser/src/main/java/mozilla')
-rw-r--r--autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListData.kt2
-rw-r--r--autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/ext/ByteArray.kt6
2 files changed, 4 insertions, 4 deletions
diff --git a/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListData.kt b/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListData.kt
index dcef3574..7a17a80f 100644
--- a/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListData.kt
+++ b/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/PublicSuffixListData.kt
@@ -144,7 +144,7 @@ internal class PublicSuffixListData(private val rules: ByteArray, private val ex
companion object {
- val WILDCARD_LABEL = byteArrayOf('*'.toByte())
+ val WILDCARD_LABEL = byteArrayOf('*'.code.toByte())
val PREVAILING_RULE = listOf("*")
val EMPTY_RULE = listOf<String>()
const val EXCEPTION_MARKER = '!'
diff --git a/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/ext/ByteArray.kt b/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/ext/ByteArray.kt
index 59627723..5665db60 100644
--- a/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/ext/ByteArray.kt
+++ b/autofill-parser/src/main/java/mozilla/components/lib/publicsuffixlist/ext/ByteArray.kt
@@ -42,7 +42,7 @@ internal fun ByteArray.binarySearch(labels: List<ByteArray>, labelIndex: Int): S
val byte0 =
if (expectDot) {
expectDot = false
- '.'.toByte()
+ '.'.code.toByte()
} else {
labels[currentLabelIndex][currentLabelByteIndex] and BITMASK
}
@@ -109,7 +109,7 @@ internal fun ByteArray.binarySearch(labels: List<ByteArray>, labelIndex: Int): S
/** Search for a '\n' that marks the start of a value. Don't go back past the start of the array. */
private fun ByteArray.findStartOfLineFromIndex(start: Int): Int {
var index = start
- while (index > -1 && this[index] != '\n'.toByte()) {
+ while (index > -1 && this[index] != '\n'.code.toByte()) {
index--
}
index++
@@ -119,7 +119,7 @@ private fun ByteArray.findStartOfLineFromIndex(start: Int): Int {
/** Search for a '\n' that marks the end of a value. */
private fun ByteArray.findEndOfLineFromIndex(start: Int): Int {
var end = 1
- while (this[start + end] != '\n'.toByte()) {
+ while (this[start + end] != '\n'.code.toByte()) {
end++
}
return end