All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.squareup.workflow1.internal.IdCounter.kt Maven / Gradle / Ivy

package com.squareup.workflow1.internal

/**
 * Monotonically-increasing counter that produces longs, used to assign
 * [com.squareup.workflow1.WorkflowInterceptor.WorkflowSession.sessionId].
 */
internal class IdCounter {
  private var nextId = 0L
  fun createId(): Long = nextId++
}

@Suppress("NOTHING_TO_INLINE")
internal inline fun IdCounter?.createId(): Long = this?.createId() ?: 0




© 2015 - 2024 Weber Informatics LLC | Privacy Policy