Mercurial > repos > blastem
comparison tern.c @ 2217:8483c685cf03
Allow tern_foreach on an empty (NULL) ternary tree
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 30 Aug 2022 18:43:08 -0700 |
parents | de3d20e58555 |
children |
comparison
equal
deleted
inserted
replaced
2216:4e27c36f947c | 2217:8483c685cf03 |
---|---|
284 } | 284 } |
285 } | 285 } |
286 | 286 |
287 void tern_foreach(tern_node *head, iter_fun fun, void *data) | 287 void tern_foreach(tern_node *head, iter_fun fun, void *data) |
288 { | 288 { |
289 if (!head) { | |
290 return; | |
291 } | |
289 //lame, but good enough for my purposes | 292 //lame, but good enough for my purposes |
290 char key[MAX_ITER_KEY+1]; | 293 char key[MAX_ITER_KEY+1]; |
291 tern_foreach_int(head, fun, data, key, 0); | 294 tern_foreach_int(head, fun, data, key, 0); |
292 } | 295 } |
293 | 296 |