[前][次][番号順一覧][スレッド一覧]

ruby-changes:69685

From: Nobuyoshi <ko1@a...>
Date: Wed, 10 Nov 2021 18:17:41 +0900 (JST)
Subject: [ruby-changes:69685] 8bcff5604b (master): Tentative fix of subsec to `Time.at` [Bug #18293]

https://git.ruby-lang.org/ruby.git/commit/?id=8bcff5604b

From 8bcff5604b15fd29f357669dd8cb65a6618c9926 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 10 Nov 2021 18:14:14 +0900
Subject: Tentative fix of subsec to `Time.at` [Bug #18293]

---
 time.c   | 2 +-
 timev.rb | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/time.c b/time.c
index 9ecc09347cd..44864ff748c 100644
--- a/time.c
+++ b/time.c
@@ -2683,7 +2683,7 @@ time_s_at(rb_execution_context_t *ec, VALUE klass, VALUE time, VALUE subsec, VAL https://github.com/ruby/ruby/blob/trunk/time.c#L2683
     VALUE t;
     wideval_t timew;
 
-    if (!NIL_P(subsec)) {
+    if (subsec) {
         int scale = get_scale(unit);
         time = num_exact(time);
         t = num_exact(subsec);
diff --git a/timev.rb b/timev.rb
index b73d8c8cc0a..4d4204115d3 100644
--- a/timev.rb
+++ b/timev.rb
@@ -267,7 +267,7 @@ class Time https://github.com/ruby/ruby/blob/trunk/timev.rb#L267
   # :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
 
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]