Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 41x 14406x 14406x 878x 878x 13528x 14406x 13528x 14406x 13528x 14406x 34017x 34017x 34017x 7678x 34017x 10967x 10967x 34017x 2561x 14406x 41x 173x 173x 173x 865x 865x 865x 519x 865x 346x 346x 346x 346x 865x 173x 173x 41x 4034x 4034x 4034x 4034x 4034x 4034x 2952x 4026x 1082x 1082x 4034x 4034x 41x 2017x 2017x 2017x 10085x 10085x 6051x 6051x 4034x 4034x 2017x 2017x 41x 41x 1360x 1360x 1360x 1360x 1360x 1360x 1360x 1360x 400x 400x 1360x 1360x 1360x 3621x 2x 1x 1x 2x 2x 3621x 1360x 1360x 1360x 3279x 3214x 3214x 3279x 3279x 1360x 1360x 1360x 1221x 1360x 139x 139x 1360x 1360x 1360x | // Copyright (c) ZeroC, Inc. import { ArrayUtil } from "./ArrayUtil.js"; import { HashUtil } from "./HashUtil.js"; import { StreamHelpers } from "./StreamHelpers.js"; // // Use generic equality test from ArrayUtil. // const eq = ArrayUtil.eq; function equals(other) { if (this === other) { return true; } if (other === null || other === undefined) { return false; } if (this.prototype !== other.prototype) { return false; } for (const key in this) { const e1 = this[key]; const e2 = other[key]; if (typeof e1 == "function") { continue; // Don't need to compare functions } else if (!eq(e1, e2)) { return false; } } return true; } function clone() { const other = new this.constructor(); for (const key in this) { const e = this[key]; if (e === undefined || e === null) { other[key] = e; } else if (typeof e == "function") { continue; } else if (typeof e.clone == "function") { other[key] = e.clone(); } else if (e instanceof Array) { other[key] = ArrayUtil.clone(e); } else { other[key] = e; } } return other; } function memberHashCode(h, e) { if (typeof e.hashCode == "function") { return HashUtil.addHashable(h, e); } else if (e instanceof Array) { return HashUtil.addArray(h, e, memberHashCode); } else { const t = typeof e; if (e instanceof String || t == "string") { return HashUtil.addString(h, e); } else if (e instanceof Number || t == "number") { return HashUtil.addNumber(h, e); } else if (e instanceof Boolean || t == "boolean") { return HashUtil.addBoolean(h, e); } } } function hashCode() { let h = 5381; for (const key in this) { const e = this[key]; if (e === undefined || e === null || typeof e == "function") { continue; } h = memberHashCode(h, e); } return h; } export function defineStruct(obj, legalKeyType, variableLength) { obj.prototype.clone = clone; obj.prototype.equals = equals; // // Only generate hashCode if this structure type is a legal dictionary key type. // if (legalKeyType) { obj.prototype.hashCode = hashCode; } if (obj.prototype._write && obj.prototype._read) { obj.write = function (os, v) { if (!v) { if (!obj.prototype._nullMarshalValue) { obj.prototype._nullMarshalValue = new this(); } v = obj.prototype._nullMarshalValue; } v._write(os); }; obj.read = function (is, v) { if (!v || !(v instanceof this)) { v = new this(); } v._read(is); return v; }; if (variableLength) { StreamHelpers.FSizeOptHelper.call(obj); } else { StreamHelpers.VSizeOptHelper.call(obj); } } return obj; } |