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

Commit 9a1b9bbb authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Log Set of listener callbacks" into main

parents dd2a9044 59c47a28
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) } }
    }
}