mirror of
https://github.com/logos-storage/nim-chroprof.git
synced 2026-01-02 13:33:06 +00:00
20 lines
435 B
Nim
20 lines
435 B
Nim
import std/options
|
|
import chronos/srcloc
|
|
|
|
proc push*(self: var seq[uint], value: uint): void =
|
|
self.add(value)
|
|
|
|
proc pop*(self: var seq[uint]): uint =
|
|
let value = self[^1]
|
|
self.setLen(self.len - 1)
|
|
value
|
|
|
|
proc peek*(self: var seq[uint]): Option[uint] =
|
|
if self.len == 0:
|
|
none(uint)
|
|
else:
|
|
self[^1].some
|
|
|
|
proc `$`*(location: SrcLoc): string =
|
|
$location.procedure & "[" & $location.file & ":" & $location.line & "]"
|