Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
static thriftSpanEqual(spanOne, spanTwo) {
// TODO(oibe) in references diff add equality check here
return bufferEqual(spanOne.traceIdLow, spanTwo.traceIdLow) &&
bufferEqual(spanOne.traceIdHigh, spanTwo.traceIdHigh) &&
bufferEqual(spanOne.spanId, spanTwo.spanId) &&
bufferEqual(spanOne.parentSpanId, spanTwo.parentSpanId) &&
spanOne.operationName === spanTwo.operationName &&
spanOne.flags === spanTwo.flags &&
bufferEqual(spanOne.startTime, spanTwo.startTime) &&
bufferEqual(spanOne.duration, spanTwo.duration);
}
}
static thriftSpanEqual(spanOne, spanTwo) {
// TODO(oibe) in references diff add equality check here
return bufferEqual(spanOne.traceIdLow, spanTwo.traceIdLow) &&
bufferEqual(spanOne.traceIdHigh, spanTwo.traceIdHigh) &&
bufferEqual(spanOne.spanId, spanTwo.spanId) &&
bufferEqual(spanOne.parentSpanId, spanTwo.parentSpanId) &&
spanOne.operationName === spanTwo.operationName &&
spanOne.flags === spanTwo.flags &&
bufferEqual(spanOne.startTime, spanTwo.startTime) &&
bufferEqual(spanOne.duration, spanTwo.duration);
}
}
static thriftSpanEqual(spanOne, spanTwo) {
// TODO(oibe) in references diff add equality check here
return bufferEqual(spanOne.traceIdLow, spanTwo.traceIdLow) &&
bufferEqual(spanOne.traceIdHigh, spanTwo.traceIdHigh) &&
bufferEqual(spanOne.spanId, spanTwo.spanId) &&
bufferEqual(spanOne.parentSpanId, spanTwo.parentSpanId) &&
spanOne.operationName === spanTwo.operationName &&
spanOne.flags === spanTwo.flags &&
bufferEqual(spanOne.startTime, spanTwo.startTime) &&
bufferEqual(spanOne.duration, spanTwo.duration);
}
}
static thriftSpanEqual(spanOne, spanTwo) {
// TODO(oibe) in references diff add equality check here
return bufferEqual(spanOne.traceIdLow, spanTwo.traceIdLow) &&
bufferEqual(spanOne.traceIdHigh, spanTwo.traceIdHigh) &&
bufferEqual(spanOne.spanId, spanTwo.spanId) &&
bufferEqual(spanOne.parentSpanId, spanTwo.parentSpanId) &&
spanOne.operationName === spanTwo.operationName &&
spanOne.flags === spanTwo.flags &&
bufferEqual(spanOne.startTime, spanTwo.startTime) &&
bufferEqual(spanOne.duration, spanTwo.duration);
}
}
static thriftSpanEqual(spanOne, spanTwo) {
// TODO(oibe) in references diff add equality check here
return bufferEqual(spanOne.traceIdLow, spanTwo.traceIdLow) &&
bufferEqual(spanOne.traceIdHigh, spanTwo.traceIdHigh) &&
bufferEqual(spanOne.spanId, spanTwo.spanId) &&
bufferEqual(spanOne.parentSpanId, spanTwo.parentSpanId) &&
spanOne.operationName === spanTwo.operationName &&
spanOne.flags === spanTwo.flags &&
bufferEqual(spanOne.startTime, spanTwo.startTime) &&
bufferEqual(spanOne.duration, spanTwo.duration);
}
}
static thriftSpanEqual(spanOne, spanTwo) {
// TODO(oibe) in references diff add equality check here
return bufferEqual(spanOne.traceIdLow, spanTwo.traceIdLow) &&
bufferEqual(spanOne.traceIdHigh, spanTwo.traceIdHigh) &&
bufferEqual(spanOne.spanId, spanTwo.spanId) &&
bufferEqual(spanOne.parentSpanId, spanTwo.parentSpanId) &&
spanOne.operationName === spanTwo.operationName &&
spanOne.flags === spanTwo.flags &&
bufferEqual(spanOne.startTime, spanTwo.startTime) &&
bufferEqual(spanOne.duration, spanTwo.duration);
}
}
function isEqual(a, b) {
if (!(Buffer.isBuffer(a) && Buffer.isBuffer(b))) return a === b;
return bufferEqual(a, b);
}
export function isEqual (a:Slice, b:Slice):boolean {
if (!(Buffer.isBuffer(a) && Buffer.isBuffer(b))) return a === b
return bufferEqual(a, b)
}