Skip to content

Commit 82d8ac9

Browse files
gnpricechrisbobbe
authored andcommitted
android [nfc]: Simplify bits of TextCompression using Kotlin
1 parent e272b7d commit 82d8ac9

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

android/app/src/main/java/com/zulipmobile/TextCompression.kt

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import com.facebook.react.bridge.ReactMethod
88
import java.io.ByteArrayOutputStream
99
import java.io.IOException
1010
import java.io.UnsupportedEncodingException
11-
import java.util.HashMap
1211
import java.util.zip.DataFormatException
1312
import java.util.zip.Deflater
1413
import java.util.zip.Inflater
@@ -17,19 +16,13 @@ import java.util.zip.Inflater
1716
// https://github.com/zulip/zulip-mobile/blob/main/docs/howto/testing.md#unit-tests-android.
1817
internal class TextCompressionModule(reactContext: ReactApplicationContext?) :
1918
ReactContextBaseJavaModule(reactContext) {
20-
override fun getName(): String {
21-
return "TextCompressionModule"
22-
}
19+
override fun getName(): String = "TextCompressionModule"
2320

2421
// TODO: Experiment what value gives the best performance.
2522
private val bufferSize = 8192
2623

2724
private val header = "z|zlib base64|"
28-
override fun getConstants(): Map<String, Any> {
29-
val constants: MutableMap<String, Any> = HashMap()
30-
constants["header"] = header
31-
return constants
32-
}
25+
override fun getConstants(): Map<String, Any> = hashMapOf("header" to header)
3326

3427
@ReactMethod
3528
fun compress(input: String, promise: Promise) {

0 commit comments

Comments
 (0)