ruby-changes:39845
From: nobu <ko1@a...>
Date: Thu, 24 Sep 2015 14:20:44 +0900 (JST)
Subject: [ruby-changes:39845] nobu:r51926 (trunk): file.c: same timespec
nobu 2015-09-24 14:20:32 +0900 (Thu, 24 Sep 2015) New Revision: 51926 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51926 Log: file.c: same timespec * file.c (rb_file_s_utime): same timespec for same time object. assume time objects are static. Modified files: trunk/file.c Index: file.c =================================================================== --- file.c (revision 51925) +++ file.c (revision 51926) @@ -2686,7 +2686,10 @@ rb_file_s_utime(int argc, VALUE *argv) https://github.com/ruby/ruby/blob/trunk/file.c#L2686 if (!NIL_P(args.atime) || !NIL_P(args.mtime)) { tsp = tss; tsp[0] = rb_time_timespec(args.atime); - tsp[1] = rb_time_timespec(args.mtime); + if (args.atime == args.mtime) + tsp[1] = tsp[0]; + else + tsp[1] = rb_time_timespec(args.mtime); } args.tsp = tsp; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/