1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Tentative fix of subsec to Time.at [Bug #18293]

This commit is contained in:
Nobuyoshi Nakada 2021-11-10 18:14:14 +09:00
parent 850912b6e0
commit 8bcff5604b
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6
2 changed files with 2 additions and 2 deletions

2
time.c
View file

@ -2683,7 +2683,7 @@ time_s_at(rb_execution_context_t *ec, VALUE klass, VALUE time, VALUE subsec, VAL
VALUE t;
wideval_t timew;
if (!NIL_P(subsec)) {
if (subsec) {
int scale = get_scale(unit);
time = num_exact(time);
t = num_exact(subsec);

View file

@ -267,7 +267,7 @@ class Time
# :include: doc/time/nsec.rdoc
# :include: doc/time/in.rdoc
#
def self.at(time, subsec = nil, unit = :microsecond, in: nil)
def self.at(time, subsec = false, unit = :microsecond, in: nil)
__builtin.time_s_at(time, subsec, unit, __builtin.arg!(:in))
end