MCPcopy Create free account
hub / github.com/Wscats/vscode-explore / cmp

Method cmp

contextKeyExpr/src/contextkey.ts:1105–1122  ·  view source on GitHub ↗
(other: ContextKeyExpression)

Source from the content-addressed store, hash-verified

1103 }
1104
1105 public cmp(other: ContextKeyExpression): number {
1106 if (other.type !== this.type) {
1107 return this.type - other.type;
1108 }
1109 if (this.expr.length < other.expr.length) {
1110 return -1;
1111 }
1112 if (this.expr.length > other.expr.length) {
1113 return 1;
1114 }
1115 for (let i = 0, len = this.expr.length; i < len; i++) {
1116 const r = cmp(this.expr[i], other.expr[i]);
1117 if (r !== 0) {
1118 return r;
1119 }
1120 }
1121 return 0;
1122 }
1123
1124 public equals(other: ContextKeyExpression): boolean {
1125 if (other.type === this.type) {

Callers

nothing calls this directly

Calls 1

cmpFunction · 0.70

Tested by

no test coverage detected