MCPcopy Create free account
hub / github.com/git/git / preorder

Function preorder

compat/regex/regcomp.c:1254–1282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1252 prev = node;
1253 node = node->parent;
1254 }
1255 /* Go up while we have a node that is reached from the right. */
1256 while (node->right == prev || node->right == NULL);
1257 node = node->right;
1258 }
1259}
1260
1261static reg_errcode_t
1262preorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)),
1263 void *extra)
1264{
1265 bin_tree_t *node;
1266
1267 for (node = root; ; )
1268 {
1269 reg_errcode_t err = fn (extra, node);
1270 if (BE (err != REG_NOERROR, 0))
1271 return err;
1272
1273 /* Go to the left node, or up and to the right. */
1274 if (node->left)
1275 node = node->left;
1276 else
1277 {
1278 bin_tree_t *prev = NULL;
1279 while (node->right == prev || node->right == NULL)
1280 {
1281 prev = node;
1282 node = node->parent;
1283 if (!node)
1284 return REG_NOERROR;
1285 }

Callers 1

analyzeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected