Use actual step indices when walking subgraphs

This commit is contained in:
Max Brunsfeld 2020-06-25 13:09:38 -07:00
parent 7f955419a8
commit e3cf5df039
2 changed files with 193 additions and 205 deletions

View file

@ -90,6 +90,20 @@ extern "C" {
} \
} while (0);
#define array_insert_sorted_by(self, start, field, value) \
do { \
unsigned index, exists; \
array_search_sorted_by(self, start, field, (value) field, &index, &exists); \
if (!exists) array_insert(self, index, value); \
} while (0);
#define array_insert_sorted_with(self, start, compare, value) \
do { \
unsigned index, exists; \
array_search_sorted_with(self, start, compare, &(value), &index, &exists); \
if (!exists) array_insert(self, index, value); \
} while (0);
// Private
typedef Array(void) VoidArray;