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

Function re_node_set_insert_last

compat/regex/regex_internal.c:1348–1366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1346/* Insert the new element ELEM to the re_node_set* SET.
1347 SET should not already have any element greater than or equal to ELEM.
1348 Return -1 if an error has occurred, return 1 otherwise. */
1349
1350static int
1351internal_function
1352re_node_set_insert_last (re_node_set *set, int elem)
1353{
1354 /* Realloc if we need. */
1355 if (set->alloc == set->nelem)
1356 {
1357 int *new_elems;
1358 set->alloc = (set->alloc + 1) * 2;
1359 new_elems = re_realloc (set->elems, int, set->alloc);
1360 if (BE (new_elems == NULL, 0))
1361 return -1;
1362 set->elems = new_elems;
1363 }
1364
1365 /* Insert the new element. */
1366 set->elems[set->nelem++] = elem;
1367 return 1;
1368}
1369

Callers 2

register_stateFunction · 0.85
calc_inveclosureFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected