Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59c47a28 authored by Beverly's avatar Beverly Committed by Beverly Tai
Browse files

Log Set of listener callbacks

Test: builds
Bug: 394230633
Flag: EXEMPT bugfix
Change-Id: I4eab603240c82fe2e263dac8217727f05c3be1ed
parent 3e86d185
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -27,13 +27,13 @@ public object ListenersTracing {
     * listeners.forEach { it.dispatch(state) }
     * ```
     *
     * often it's tricky to udnerstand which listener is causing delays. This can be used instead to
     * often it's tricky to understand which listener is causing delays. This can be used instead to
     * log how much each listener is taking:
     * ```
     * listeners.forEachTraced(TAG) { it.dispatch(state) }
     * ```
     */
    public inline fun <T : Any> List<T>.forEachTraced(tag: String = "", f: (T) -> Unit) {
    public inline fun <T : Any> Iterable<T>.forEachTraced(tag: String = "", f: (T) -> Unit) {
        forEach { traceSection({ "$tag#${it::javaClass.get().name}" }) { f(it) } }
    }
}