teptris 0.2.48 → 0.2.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/teptris_ext/materialize.c +9 -4
- data/lib/teptris/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b6cebca031f6e3c203926fd5192caa04650d41fb5726fd0989f41b9639c45e7f
|
|
4
|
+
data.tar.gz: 044e2bb206121f34bb5b10a461055e1cbde5ed37316d289727d9c6f90f66af9c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 01c9f38cb3eb9048ecd662892b1715d7762a37f41f9a4f0159ab692edb781a8af378afa62cd00df477ce8a2d67b7ae1b08387222a7765817dabbafb013deb1d4
|
|
7
|
+
data.tar.gz: fa7e42685c337bfaad7f62ac46cc1dfb6b8a85cced308645e08c20e36b8c9667ee98adf07f44b30091541a809dd6a5e305b72d31032c501603306f532e2af883
|
|
@@ -41,11 +41,16 @@ static VALUE time_from_dt(const teptris_datetime *d, bool has_offset) {
|
|
|
41
41
|
}
|
|
42
42
|
return rb_time_num_new(num, INT2FIX(d->offset_seconds));
|
|
43
43
|
}
|
|
44
|
+
/* whole seconds skip the Rational: Time.local normalizes
|
|
45
|
+
* Rational(s * 1e9, 1e9) to exactly s, so an Integer is the same
|
|
46
|
+
* result without the allocation or the rational path */
|
|
47
|
+
VALUE sec = (d->nanosecond != 0)
|
|
48
|
+
? rb_Rational(LL2NUM((int64_t)d->second * 1000000000 +
|
|
49
|
+
d->nanosecond),
|
|
50
|
+
LL2NUM(1000000000))
|
|
51
|
+
: INT2FIX(d->second);
|
|
44
52
|
VALUE args[6] = {INT2FIX(d->year), INT2FIX(d->month), INT2FIX(d->day),
|
|
45
|
-
INT2FIX(d->hour), INT2FIX(d->minute),
|
|
46
|
-
rb_Rational(LL2NUM((int64_t)d->second * 1000000000 +
|
|
47
|
-
d->nanosecond),
|
|
48
|
-
LL2NUM(1000000000))};
|
|
53
|
+
INT2FIX(d->hour), INT2FIX(d->minute), sec};
|
|
49
54
|
return rb_funcallv(rb_cTime, rb_intern("local"), 6, args);
|
|
50
55
|
}
|
|
51
56
|
|
data/lib/teptris/version.rb
CHANGED