diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-07-23 08:38:24 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-07-23 08:38:24 +0900 |
| commit | 8b6f6faf1e3771c04a1e2a58b1bbc84fe7d5c1e2 (patch) | |
| tree | da9b0454a565a6bcef677bb0d7229d102daa1160 /src/time.c | |
| parent | 8dc69cf216b265859732ba4600cdc4d1fb1c65d1 (diff) | |
| download | mruby-8b6f6faf1e3771c04a1e2a58b1bbc84fe7d5c1e2.tar.gz mruby-8b6f6faf1e3771c04a1e2a58b1bbc84fe7d5c1e2.zip | |
separate sec and usec in mrb_time_plus
Diffstat (limited to 'src/time.c')
| -rw-r--r-- | src/time.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/time.c b/src/time.c index f3072b7d9..938e8af36 100644 --- a/src/time.c +++ b/src/time.c @@ -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 |
