зеркало из https://github.com/github/ruby.git
Tentative fix of subsec to `Time.at` [Bug #18293]
This commit is contained in:
Родитель
850912b6e0
Коммит
8bcff5604b
2
time.c
2
time.c
|
@ -2683,7 +2683,7 @@ time_s_at(rb_execution_context_t *ec, VALUE klass, VALUE time, VALUE subsec, VAL
|
||||||
VALUE t;
|
VALUE t;
|
||||||
wideval_t timew;
|
wideval_t timew;
|
||||||
|
|
||||||
if (!NIL_P(subsec)) {
|
if (subsec) {
|
||||||
int scale = get_scale(unit);
|
int scale = get_scale(unit);
|
||||||
time = num_exact(time);
|
time = num_exact(time);
|
||||||
t = num_exact(subsec);
|
t = num_exact(subsec);
|
||||||
|
|
2
timev.rb
2
timev.rb
|
@ -267,7 +267,7 @@ class Time
|
||||||
# :include: doc/time/nsec.rdoc
|
# :include: doc/time/nsec.rdoc
|
||||||
# :include: doc/time/in.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))
|
__builtin.time_s_at(time, subsec, unit, __builtin.arg!(:in))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче