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

Function streamDecrID

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

Set 'id' to be its predecessor stream ID. * If 'id' is the minimal possible id, it remains 0-0 and a C_ERR is * returned. */

Source from the content-addressed store, hash-verified

112 * If 'id' is the minimal possible id, it remains 0-0 and a C_ERR is
113 * returned. */
114int streamDecrID(streamID *id) {
115 int ret = C_OK;
116 if (id->seq == 0) {
117 if (id->ms == 0) {
118 /* Special case where 'id' is the first possible streamID... */
119 id->ms = id->seq = UINT64_MAX;
120 ret = C_ERR;
121 } else {
122 id->ms--;
123 id->seq = UINT64_MAX;
124 }
125 } else {
126 id->seq--;
127 }
128 return ret;
129}
130
131/* Generate the next stream item ID given the previous one. If the current
132 * milliseconds Unix time is greater than the previous one, just use this

Callers 3

RM_StreamIteratorStartFunction · 0.85
xrangeGenericCommandFunction · 0.85
xpendingCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected