@@ -780,7 +780,7 @@ TCompactProtocol.prototype.readString = function() {
780
780
* if there is another byte to follow. This can read up to 5 bytes.
781
781
*/
782
782
TCompactProtocol . prototype . readVarint32 = function ( ) {
783
- return this . readVarint64 ( ) ;
783
+ return this . readVarint64 ( ) . toNumber ( ) ;
784
784
} ;
785
785
786
786
/**
@@ -811,8 +811,7 @@ TCompactProtocol.prototype.readVarint64 = function() {
811
811
throw new Thrift . TProtocolException ( Thrift . TProtocolExceptionType . INVALID_DATA , "Variable-length int over 10 bytes." ) ;
812
812
}
813
813
}
814
- var i64 = new Int64 ( hi , lo ) ;
815
- return i64 . toNumber ( ) ;
814
+ return new Int64 ( hi , lo ) ;
816
815
} ;
817
816
818
817
/**
@@ -826,9 +825,8 @@ TCompactProtocol.prototype.zigzagToI32 = function(n) {
826
825
* Convert from zigzag long to long.
827
826
*/
828
827
TCompactProtocol . prototype . zigzagToI64 = function ( n ) {
829
- var zz = new Int64 ( n ) ;
830
- var hi = zz . buffer . readUInt32BE ( 0 , true ) ;
831
- var lo = zz . buffer . readUInt32BE ( 4 , true ) ;
828
+ var hi = n . buffer . readUInt32BE ( 0 , true ) ;
829
+ var lo = n . buffer . readUInt32BE ( 4 , true ) ;
832
830
833
831
var neg = new Int64 ( hi & 0 , lo & 1 ) ;
834
832
neg . _2scomp ( ) ;
@@ -838,8 +836,7 @@ TCompactProtocol.prototype.zigzagToI64 = function(n) {
838
836
var hi_lo = ( hi << 31 ) ;
839
837
hi = ( hi >>> 1 ) ^ ( hi_neg ) ;
840
838
lo = ( ( lo >>> 1 ) | hi_lo ) ^ ( lo_neg ) ;
841
- var i64 = new Int64 ( hi , lo ) ;
842
- return i64 . toNumber ( ) ;
839
+ return new Int64 ( hi , lo ) ;
843
840
} ;
844
841
845
842
TCompactProtocol . prototype . skip = function ( type ) {
0 commit comments