Minor Kotlin cleanup (#49000)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/49000

Just found those nits around while looking at the codebase.
This clears things out and should have no runtime impact.

Changelog:
[Internal] [Changed] -

Reviewed By: mdvacca

Differential Revision: D68768384

fbshipit-source-id: bd3a30f1792a6f662d1f5b25855c89b6d43e72bb
This commit is contained in:
Nicola Corti
2025-01-28 11:37:53 -08:00
committed by Facebook GitHub Bot
parent c93bd436a5
commit d797b7aa4d
4 changed files with 6 additions and 9 deletions
@@ -26,7 +26,7 @@ internal class TransformAnimatedNode(
transformConfigs =
if (transforms == null) emptyList()
else
List<TransformConfig>(transforms.size()) { i ->
List(transforms.size()) { i ->
val transformConfigMap = checkNotNull(transforms.getMap(i))
val property = transformConfigMap.getString("property")
val type = transformConfigMap.getString("type")
@@ -46,7 +46,7 @@ internal class TransformAnimatedNode(
fun collectViewUpdates(propsMap: JavaOnlyMap) {
val transforms =
List<JavaOnlyMap>(transformConfigs.size) { i ->
List(transformConfigs.size) { i ->
val transformConfig = transformConfigs[i]
val transform =
if (transformConfig is AnimatedTransformConfig) {
@@ -16,4 +16,4 @@ import com.facebook.proguard.annotations.DoNotStrip
*/
@DoNotStrip
internal class ObjectAlreadyConsumedException @DoNotStrip constructor(detailMessage: String) :
RuntimeException(detailMessage) {}
RuntimeException(detailMessage)
@@ -19,10 +19,7 @@ internal class DestroyUnmountedViewMountItem(
) : MountItem {
override fun execute(mountingManager: MountingManager) {
val surfaceMountingManager = mountingManager.getSurfaceManager(_surfaceId)
if (surfaceMountingManager == null) {
return
}
val surfaceMountingManager = mountingManager.getSurfaceManager(_surfaceId) ?: return
surfaceMountingManager.deleteView(reactTag)
}
@@ -31,11 +31,11 @@ internal class DevLoadingModule(reactContext: ReactApplicationContext) :
}
override fun showMessage(message: String, color: Double?, backgroundColor: Double?) {
UiThreadUtil.runOnUiThread(Runnable { devLoadingViewManager?.showMessage(message) })
UiThreadUtil.runOnUiThread { devLoadingViewManager?.showMessage(message) }
}
override fun hide() {
UiThreadUtil.runOnUiThread(Runnable { devLoadingViewManager?.hide() })
UiThreadUtil.runOnUiThread { devLoadingViewManager?.hide() }
}
companion object {