remove unnecessary utils.kt

This commit is contained in:
Alexander Nozik 2021-01-28 12:37:43 +03:00
parent 5829c12372
commit edcc3e4956
2 changed files with 8 additions and 13 deletions

View File

@ -115,11 +115,16 @@ internal class ProtoNumassPoint(
public class ProtoBlock(
override val channel: Int,
private val block: Point.Channel.Block,
public val parent: NumassPoint? = null,
parent: NumassPoint? = null,
) : NumassBlock {
override val startTime: Instant
get() = epochNanoTime(block.time)
get(){
val nanos = block.time
val seconds = Math.floorDiv(nanos, 1e9.toInt().toLong())
val reminder = (nanos % 1e9).toInt()
return Instant.ofEpochSecond(seconds, reminder.toLong())
}
override val length: Duration = when {
block.length > 0 -> Duration.ofNanos(block.length)
@ -150,7 +155,7 @@ public class ProtoBlock(
}.asFlow()
} else {
emptyFlow<NumassEvent>()
emptyFlow()
}

View File

@ -1,10 +0,0 @@
package ru.inr.mass.data.proto
import java.time.Instant
internal fun epochNanoTime(nanos: Long): Instant {
val seconds = Math.floorDiv(nanos, 1e9.toInt().toLong())
val reminder = (nanos % 1e9).toInt()
return Instant.ofEpochSecond(seconds, reminder.toLong())
}