mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
added an assertion
This commit is contained in:
@@ -439,7 +439,9 @@ when not defined(JS):
|
||||
proc getTime(): Time = return timec(nil)
|
||||
proc getLocalTime(t: Time): TimeInfo =
|
||||
var a = t
|
||||
result = tmToTimeInfo(localtime(addr(a))[], true)
|
||||
let lt = localtime(addr(a))
|
||||
assert(not lt.isNil)
|
||||
result = tmToTimeInfo(lt[], true)
|
||||
# copying is needed anyway to provide reentrancity; thus
|
||||
# the conversion is not expensive
|
||||
|
||||
|
||||
Reference in New Issue
Block a user