making some code clearer

This commit is contained in:
Tibor Kaputa 2022-07-31 16:59:59 +02:00 committed by GitHub
parent cd851feffc
commit f6060ac251
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,10 +11,11 @@ private var cachedEmojiData: MutableList<String>? = null
* @param context The initiating view's context.
* @param path The path to the asset file.
*/
fun parseRawEmojiSpecsFile(
context: Context, path: String
): MutableList<String> {
cachedEmojiData?.let { return it }
fun parseRawEmojiSpecsFile(context: Context, path: String): MutableList<String> {
if (cachedEmojiData != null) {
return cachedEmojiData!!
}
val emojis = mutableListOf<String>()
var emojiEditorList: MutableList<String>? = null
@ -39,6 +40,7 @@ fun parseRawEmojiSpecsFile(
if (!line.startsWith("\t")) {
commitEmojiEditorList()
}
// Assume it is a data line
val data = line.split(";")
if (data.size == 3) {