ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CBOR-XS/XS.pm
(Generate patch)

Comparing CBOR-XS/XS.pm (file contents):
Revision 1.58 by root, Tue Apr 26 16:07:04 2016 UTC vs.
Revision 1.59 by root, Tue Apr 26 16:25:49 2016 UTC

1206} 1206}
1207 1207
1208sub Math::BigRat::TO_CBOR { 1208sub Math::BigRat::TO_CBOR {
1209 my ($n, $d) = $_[0]->parts; 1209 my ($n, $d) = $_[0]->parts;
1210 1210
1211 # older versions of BigRat need *=1, as they not always return numbers
1212
1211 $d == 1 1213 $d*1 == 1
1212 ? $n 1214 ? $n*1
1213 : tag 30, [$n, $d] 1215 : tag 30, [$n*1, $d*1]
1214} 1216}
1215 1217
1216sub Time::Piece::TO_CBOR { 1218sub Time::Piece::TO_CBOR {
1217 tag 1, 0 + $_[0]->epoch 1219 tag 1, 0 + $_[0]->epoch
1218} 1220}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines