[strings] fixing and simplifying string tree iterator. This version is inspired by Python's itertools.product (itertoolsmodule.c has so many goodies)

This commit is contained in:
Al
2016-12-31 03:22:17 -05:00
parent 261ec3888a
commit 475aa3dbfa
2 changed files with 21 additions and 63 deletions

View File

@@ -266,12 +266,8 @@ void string_tree_destroy(string_tree_t *self);
typedef struct string_tree_iterator {
string_tree_t *tree;
bool single_path;
uint32_t *path;
uint32_t *num_alternatives;
uint32_t num_tokens;
uint32_t cursor;
int8_t direction; // 1 or -1
uint32_t remaining;
} string_tree_iterator_t;