Austin Schuh | 7c75e58 | 2020-11-14 16:41:18 -0800 | [diff] [blame] | 1 | "use strict"; |
| 2 | Object.defineProperty(exports, "__esModule", { value: true }); |
| 3 | exports.Long = exports.createLong = void 0; |
| 4 | function createLong(low, high) { |
| 5 | return Long.create(low, high); |
| 6 | } |
| 7 | exports.createLong = createLong; |
| 8 | var Long = /** @class */ (function () { |
| 9 | function Long(low, high) { |
| 10 | this.low = low | 0; |
| 11 | this.high = high | 0; |
| 12 | } |
| 13 | Long.create = function (low, high) { |
| 14 | // Special-case zero to avoid GC overhead for default values |
| 15 | return low == 0 && high == 0 ? Long.ZERO : new Long(low, high); |
| 16 | }; |
| 17 | Long.prototype.toFloat64 = function () { |
| 18 | return (this.low >>> 0) + this.high * 0x100000000; |
| 19 | }; |
| 20 | Long.prototype.equals = function (other) { |
| 21 | return this.low == other.low && this.high == other.high; |
| 22 | }; |
| 23 | Long.ZERO = new Long(0, 0); |
| 24 | return Long; |
| 25 | }()); |
| 26 | exports.Long = Long; |