mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
separate sec and usec in mrb_time_plus
This commit is contained in:
+1
-3
@@ -344,9 +344,7 @@ mrb_time_plus(mrb_state *mrb, mrb_value self)
|
||||
mrb_get_args(mrb, "f", &f);
|
||||
tm = mrb_get_datatype(mrb, self, &mrb_time_type);
|
||||
if (!tm) return mrb_nil_value();
|
||||
f += tm->sec;
|
||||
f += (mrb_float)tm->usec / 1.0e6;
|
||||
return mrb_time_make(mrb, mrb_obj_class(mrb, self), f, 0, tm->timezone);
|
||||
return mrb_time_make(mrb, mrb_obj_class(mrb, self), tm->sec+f, tm->usec, tm->timezone);
|
||||
}
|
||||
|
||||
static mrb_value
|
||||
|
||||
Reference in New Issue
Block a user