Skip to content

Commit

Permalink
Update ktfmt component on FBS:master
Browse files Browse the repository at this point in the history
Reviewed By: zertosh, hick209

Differential Revision: D62005865

fbshipit-source-id: 48534bd6fdff412e221a009c95fba754ed15cfc7
  • Loading branch information
VladimirMakaev authored and facebook-github-bot committed Aug 30, 2024
1 parent ad5361f commit 4520ba7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion litho-core/src/main/java/com/facebook/litho/KCached.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ fun <T> ComponentScope.useCached(vararg inputs: Any?, calculator: () -> T): T {
context.getCachedValue(globalKey, hookIndex, cacheInputs)
?: calculator().also { context.putCachedValue(globalKey, hookIndex, cacheInputs, it) }

@Suppress("UNCHECKED_CAST") return result as T
@Suppress("UNCHECKED_CAST")
return result as T
}

/**
Expand Down
3 changes: 2 additions & 1 deletion litho-core/src/main/java/com/facebook/litho/KEventHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ internal class KEventHandler<E : Any, R>(
}

override fun dispatchOnEvent(eventHandler: EventHandler<*>, eventState: Any): R {
@Suppress("UNCHECKED_CAST") return onEvent(eventState as E)
@Suppress("UNCHECKED_CAST")
return onEvent(eventState as E)
}

override fun getEventDispatcher(): EventDispatcher {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class LayoutCache(oldWriteCache: Map<Any, Any?>? = null) {
}

operator fun <T> get(uniqueId: Any): T? {
@Suppress("UNCHECKED_CAST") return readCache.get(uniqueId) as? T?
@Suppress("UNCHECKED_CAST")
return readCache.get(uniqueId) as? T?
}

val writeCacheData: Map<Any, Any?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ import com.facebook.samples.litho.R
* Text component which will display a greeting with the given name.
*
* @param name the name to display in the greeting message
* @constructor Instantiates a new BootcampText component
* @property name the name that will be displayed in the greeting message
* @constructor Instantiates a new BootcampText component
*/
class ClickableText(private val name: String) : KComponent() {
override fun ComponentScope.render(): Component {
Expand Down

0 comments on commit 4520ba7

Please sign in to comment.