Update parsers

This commit is contained in:
Koitharu
2022-05-20 12:06:26 +03:00
parent 21f7b7120a
commit 790f1fb8a3
6 changed files with 18 additions and 9 deletions

View File

@@ -2,4 +2,13 @@ package org.koitharu.kotatsu.utils.ext
inline fun String?.ifNullOrEmpty(defaultValue: () -> String): String {
return if (this.isNullOrEmpty()) defaultValue() else this
}
fun String.longHashCode(): Long {
var h = 1125899906842597L
val len: Int = this.length
for (i in 0 until len) {
h = 31 * h + this[i].code
}
return h
}