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. */
| 112 | * If 'id' is the minimal possible id, it remains 0-0 and a C_ERR is |
| 113 | * returned. */ |
| 114 | int 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 |
no outgoing calls
no test coverage detected