Look the stream at 'key' and return the corresponding stream object. * The function creates a key setting it to an empty stream if needed. */
| 1660 | /* Look the stream at 'key' and return the corresponding stream object. |
| 1661 | * The function creates a key setting it to an empty stream if needed. */ |
| 1662 | robj *streamTypeLookupWriteOrCreate(client *c, robj *key, int no_create) { |
| 1663 | robj *o = lookupKeyWrite(c->db,key); |
| 1664 | if (checkType(c,o,OBJ_STREAM)) return NULL; |
| 1665 | if (o == NULL) { |
| 1666 | if (no_create) { |
| 1667 | addReplyNull(c); |
| 1668 | return NULL; |
| 1669 | } |
| 1670 | o = createStreamObject(); |
| 1671 | dbAdd(c->db,key,o); |
| 1672 | } |
| 1673 | return o; |
| 1674 | } |
| 1675 | |
| 1676 | /* Parse a stream ID in the format given by clients to Redis, that is |
| 1677 | * <ms>-<seq>, and converts it into a streamID structure. If |
no test coverage detected