Skip to content

Commit 011837a

Browse files
authored
[localization] Remove unused Bundle.toShallowMap (expo#46998)
# Why This PR is part of a series aimed at removing compilation warnings. It removes the following warning: ```gradle packages/expo-localization/android/src/main/java/expo/modules/localization/LocalizationModule.kt:176:16 - 'fun get(p0: String!): Any?' is deprecated. Deprecated in Java. ``` # How Removes unused `Bundle.toShallowMap`, which uses the deprecated `get` function # Test Plan BareExpo ✅
1 parent 027688d commit 011837a

1 file changed

Lines changed: 0 additions & 12 deletions

File tree

packages/expo-localization/android/src/main/java/expo/modules/localization/LocalizationModule.kt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import android.icu.util.LocaleData
55
import android.icu.util.ULocale
66
import android.os.Build.VERSION
77
import android.os.Build.VERSION_CODES
8-
import android.os.Bundle
98
import android.text.TextUtils.getLayoutDirectionFromLocale
109
import android.text.format.DateFormat
1110
import android.util.LayoutDirection
@@ -166,14 +165,3 @@ class LocalizationModule : Module() {
166165
)
167166
}
168167
}
169-
170-
/**
171-
* Creates a shallow [Map] from the [Bundle]. Does not traverse nested arrays and bundles.
172-
*/
173-
private fun Bundle.toShallowMap(): Map<String, Any?> {
174-
val map = HashMap<String, Any?>()
175-
for (key in this.keySet()) {
176-
map[key] = this[key]
177-
}
178-
return map
179-
}

0 commit comments

Comments
 (0)