@@ -8,7 +8,6 @@ import com.facebook.react.bridge.ReactMethod
8
8
import java.io.ByteArrayOutputStream
9
9
import java.io.IOException
10
10
import java.io.UnsupportedEncodingException
11
- import java.util.HashMap
12
11
import java.util.zip.DataFormatException
13
12
import java.util.zip.Deflater
14
13
import java.util.zip.Inflater
@@ -17,19 +16,13 @@ import java.util.zip.Inflater
17
16
// https://github.com/zulip/zulip-mobile/blob/main/docs/howto/testing.md#unit-tests-android.
18
17
internal class TextCompressionModule (reactContext : ReactApplicationContext ? ) :
19
18
ReactContextBaseJavaModule (reactContext) {
20
- override fun getName (): String {
21
- return " TextCompressionModule"
22
- }
19
+ override fun getName (): String = " TextCompressionModule"
23
20
24
21
// TODO: Experiment what value gives the best performance.
25
22
private val bufferSize = 8192
26
23
27
24
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)
33
26
34
27
@ReactMethod
35
28
fun compress (input : String , promise : Promise ) {
0 commit comments