diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2013-04-30 23:49:23 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2013-04-30 23:49:23 +0000 |
commit | 13a0f001a6ab7539b25c7c3d3bdde6e762bf7048 (patch) | |
tree | 1b00f7df67c04abe9ac5ac8ad06da4a6490be03e /dfa.c | |
parent | 6916e47018a8c6788dae5b227a259d86ccd41e52 (diff) |
Diffstat (limited to 'dfa.c')
-rw-r--r-- | dfa.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -161,7 +161,7 @@ void dump_associated_rules (file, ds) } } - bubble (rule_set, num_associated_rules); + qsort (&rule_set [1], num_associated_rules, sizeof (rule_set [1]), intcmp); fprintf (file, _(" associated rule line numbers:")); @@ -835,10 +835,8 @@ int snstods (sns, numstates, accset, nacc, hashval, newds_addr) if (!didsort) { /* We sort the states in sns so we * can compare it to oldsns quickly. - * We use bubble because there probably - * aren't very many states. */ - bubble (sns, numstates); + qsort (&sns [1], numstates, sizeof (sns [1]), intcmp); didsort = 1; } @@ -873,7 +871,7 @@ int snstods (sns, numstates, accset, nacc, hashval, newds_addr) */ if (!didsort) - bubble (sns, numstates); + qsort (&sns [1], numstates, sizeof (sns [1]), intcmp); for (i = 1; i <= numstates; ++i) dss[newds][i] = sns[i]; @@ -893,11 +891,10 @@ int snstods (sns, numstates, accset, nacc, hashval, newds_addr) else if (reject) { /* We sort the accepting set in increasing order so the * disambiguating rule that the first rule listed is considered - * match in the event of ties will work. We use a bubble - * sort since the list is probably quite small. + * match in the event of ties will work. */ - bubble (accset, nacc); + qsort (&accset [1], nacc, sizeof (accset [1]), intcmp); dfaacc[newds].dfaacc_set = allocate_integer_array (nacc + 1); |