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

Shrink timev.rb iseq size

This commit is contained in:
Nobuyoshi Nakada 2021-05-08 11:40:20 +09:00
parent 86b4c2fc3f
commit 30d2d72663
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -1,3 +1,4 @@
class Time
# Creates a new \Time object from the current system time. # Creates a new \Time object from the current system time.
# This is the same as Time.new without arguments. # This is the same as Time.new without arguments.
# #
@ -6,7 +7,7 @@
# #
# Parameter: # Parameter:
# :include: doc/time/in.rdoc # :include: doc/time/in.rdoc
def Time.now(in: nil) def self.now(in: nil)
new(in: __builtin.arg!(:in)) new(in: __builtin.arg!(:in))
end end
@ -53,11 +54,10 @@ end
# :include: doc/time/nsec.rdoc # :include: doc/time/nsec.rdoc
# :include: doc/time/in.rdoc # :include: doc/time/in.rdoc
# #
def Time.at(time, subsec = (nosubsec = true), unit = (nounit = true), in: nil) def self.at(time, subsec = (nosubsec = true), unit = (nounit = true), in: nil)
__builtin.time_s_at(time, subsec, unit, __builtin.arg!(:in), nosubsec, nounit) __builtin.time_s_at(time, subsec, unit, __builtin.arg!(:in), nosubsec, nounit)
end end
class Time
# Returns a new \Time object based the on given arguments. # Returns a new \Time object based the on given arguments.
# #
# With no positional arguments, returns the value of Time.now: # With no positional arguments, returns the value of Time.now: