Initialize an iterator at a specific offset 'idx' and make the iterator * return nodes in 'direction' direction. */
| 1093 | /* Initialize an iterator at a specific offset 'idx' and make the iterator |
| 1094 | * return nodes in 'direction' direction. */ |
| 1095 | quicklistIter *quicklistGetIteratorAtIdx(const quicklist *quicklist, |
| 1096 | const int direction, |
| 1097 | const long long idx) { |
| 1098 | quicklistEntry entry; |
| 1099 | |
| 1100 | if (quicklistIndex(quicklist, idx, &entry)) { |
| 1101 | quicklistIter *base = quicklistGetIterator(quicklist, direction); |
| 1102 | base->zi = NULL; |
| 1103 | base->current = entry.node; |
| 1104 | base->offset = entry.offset; |
| 1105 | return base; |
| 1106 | } else { |
| 1107 | return NULL; |
| 1108 | } |
| 1109 | } |
| 1110 | |
| 1111 | /* Release iterator. |
| 1112 | * If we still have a valid current node, then re-encode current node. */ |
no test coverage detected