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

Method cmp

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

Source from the content-addressed store, hash-verified

973 }
974
975 public cmp(other: ContextKeyExpression): number {
976 if (other.type !== this.type) {
977 return this.type - other.type;
978 }
979 if (this.expr.length < other.expr.length) {
980 return -1;
981 }
982 if (this.expr.length > other.expr.length) {
983 return 1;
984 }
985 for (let i = 0, len = this.expr.length; i < len; i++) {
986 const r = cmp(this.expr[i], other.expr[i]);
987 if (r !== 0) {
988 return r;
989 }
990 }
991 return 0;
992 }
993
994 public equals(other: ContextKeyExpression): boolean {
995 if (other.type === this.type) {

Callers

nothing calls this directly

Calls 1

cmpFunction · 0.70

Tested by

no test coverage detected