Skip to content

Commit

Permalink
Address Theodus comments
Browse files Browse the repository at this point in the history
  • Loading branch information
SeanTAllen authored and slayful committed Dec 20, 2017
1 parent 13dcecf commit 8a5fd4d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/time/date.pony
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,8 @@ class PosixDate
Create a date from a POSIX time. Negative arguments will be changed to zero.
"""
@ponyint_gmtime[None](this,
negative_to_zero(seconds),
negative_to_zero(nanoseconds))

fun negative_to_zero(value: I64): I64 =>
if value > 0 then
value
else
0
end
_negative_to_zero(seconds),
_negative_to_zero(nanoseconds))

fun time(): I64 =>
"""
Expand All @@ -52,3 +45,10 @@ class PosixDate
String.from_cstring(@ponyint_formattime[Pointer[U8]](this,
fmt.cstring()))
end

fun _negative_to_zero(value: I64): I64 =>
if value > 0 then
value
else
0
end

0 comments on commit 8a5fd4d

Please sign in to comment.