| 105 | } |
| 106 | |
| 107 | static bool _SlowLog_Contains |
| 108 | ( |
| 109 | const SlowLog *slowlog, |
| 110 | int t_id, |
| 111 | const char *cmd, |
| 112 | const char *query, |
| 113 | char **key, |
| 114 | SlowLogItem **item |
| 115 | ) { |
| 116 | size_t len = _compute_key(key, cmd, query); |
| 117 | rax *lookup = slowlog->lookup[t_id]; |
| 118 | *item = (SlowLogItem *)raxFind(lookup, (unsigned char *)*key, len); |
| 119 | if(*item == raxNotFound) { |
| 120 | *item = NULL; |
| 121 | } |
| 122 | |
| 123 | return (*item != NULL); |
| 124 | } |
| 125 | |
| 126 | SlowLog *SlowLog_New(void) { |
| 127 | SlowLog *slowlog = rm_malloc(sizeof(SlowLog)); |
no test coverage detected