MCPcopy Create free account
hub / github.com/F-Stack/f-stack / streamCompareID

Function streamCompareID

app/redis-6.2.6/src/t_stream.c:389–397  ·  view source on GitHub ↗

Compare two stream IDs. Return -1 if a < b, 0 if a == b, 1 if a > b. */

Source from the content-addressed store, hash-verified

387
388/* Compare two stream IDs. Return -1 if a < b, 0 if a == b, 1 if a > b. */
389int streamCompareID(streamID *a, streamID *b) {
390 if (a->ms > b->ms) return 1;
391 else if (a->ms < b->ms) return -1;
392 /* The ms part is the same. Check the sequence part. */
393 else if (a->seq > b->seq) return 1;
394 else if (a->seq < b->seq) return -1;
395 /* Everything is the same: IDs are equal. */
396 return 0;
397}
398
399void streamGetEdgeID(stream *s, int first, streamID *edge_id)
400{

Callers 7

streamAppendItemFunction · 0.85
streamTrimFunction · 0.85
streamReplyWithRangeFunction · 0.85
xreadCommandFunction · 0.85
xsetidCommandFunction · 0.85
xclaimCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected