Free entire quicklist. */
| 159 | |
| 160 | /* Free entire quicklist. */ |
| 161 | void quicklistRelease(quicklist *quicklist) { |
| 162 | unsigned long len; |
| 163 | quicklistNode *current, *next; |
| 164 | |
| 165 | current = quicklist->head; |
| 166 | len = quicklist->len; |
| 167 | while (len--) { |
| 168 | next = current->next; |
| 169 | |
| 170 | zfree(current->zl); |
| 171 | quicklist->count -= current->count; |
| 172 | |
| 173 | zfree(current); |
| 174 | |
| 175 | quicklist->len--; |
| 176 | current = next; |
| 177 | } |
| 178 | quicklistBookmarksClear(quicklist); |
| 179 | zfree(quicklist); |
| 180 | } |
| 181 | |
| 182 | /* Compress the ziplist in 'node' and update encoding details. |
| 183 | * Returns 1 if ziplist compressed successfully. |
no test coverage detected