| 23 | } |
| 24 | |
| 25 | rax *raxClone(rax *orig) { |
| 26 | rax *clone = raxNew(); |
| 27 | |
| 28 | raxIterator it; |
| 29 | raxStart(&it, orig); |
| 30 | raxSeek(&it, "^", NULL, 0); |
| 31 | |
| 32 | // For each key in the original, duplicate the key and its value in the clone. |
| 33 | while(raxNext(&it)) { |
| 34 | raxInsert(clone, it.key, it.key_len, it.data, NULL); |
| 35 | } |
| 36 | |
| 37 | raxStop(&it); |
| 38 | return clone; |
| 39 | } |
| 40 | |
| 41 | rax *raxCloneWithCallback(rax *orig, void *(*clone_callback)(void *)) { |
| 42 | rax *clone = raxNew(); |
no outgoing calls
no test coverage detected