Permalink
Browse files

Drop unused usec from FileTime.new and from_time.

  • Loading branch information...
aquasync committed Jan 20, 2012
1 parent 60f4575 commit 31eaf36bbb8b91055fe07a8f18094238290ae193
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/ole/types/base.rb
View
@@ -91,7 +91,7 @@ class FileTime < DateTime
SIZE = 8
# DateTime.new is slow... faster version for FileTime
- def self.new year, month, day, hour=0, min=0, sec=0, usec=0
+ def self.new year, month, day, hour=0, min=0, sec=0
# DateTime will remove leap and leap-leap seconds
sec = 59 if sec > 59
if month <= 2
@@ -109,9 +109,7 @@ def self.new year, month, day, hour=0, min=0, sec=0, usec=0
end if respond_to?(:new!) || respond_to?(:new0)
def self.from_time time
- time_a = time.to_a[0, 6].reverse
- time_a << time.usec unless time.respond_to? :to_datetime
- new(*time_a)
+ new(*time.to_a[0, 6].reverse)
end
def self.now

0 comments on commit 31eaf36

Please sign in to comment.