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