remove duplicated string extension

This commit is contained in:
Franek 2024-06-15 12:18:35 +02:00
parent 2a93cd5ebd
commit 40ea700e0b
No known key found for this signature in database
GPG Key ID: 0329F871B2079351
2 changed files with 1 additions and 3 deletions

View File

@ -38,7 +38,7 @@ class VulcanHebeGrades(
val column = grade.getJsonObject("Column")
val category = column.getJsonObject("Category")
val categoryText = category.getString("Name")
val code = column.getString("Code").orNullIfEmpty()
val code = column.getString("Code").takeValue()
val teacherId = getTeacherId(grade, "Creator") ?: -1
val subjectId = getSubjectId(column, "Subject") ?: -1

View File

@ -141,8 +141,6 @@ fun String.fixWhiteSpaces() = buildString(length) {
}
}.trimEnd()
fun String?.orNullIfEmpty(): String? = if (this.isNullOrEmpty()) null else this
fun CharSequence?.asColoredSpannable(colorInt: Int): Spannable {
val spannable = SpannableString(this)
spannable.setSpan(ForegroundColorSpan(colorInt), 0, spannable.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)