MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / sort_actions

Function sort_actions

extern/btyacc/output.c:388–420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386}
387
388void sort_actions()
389{
390 register int i;
391 register int j;
392 register int k;
393 register int t;
394 register int w;
395
396 order = NEW2(nvectors, Yshort);
397 nentries = 0;
398
399 for (i = 0; i < nvectors; i++)
400 {
401 if (tally[i] > 0)
402 {
403 t = tally[i];
404 w = width[i];
405 j = nentries - 1;
406
407 while (j >= 0 && (width[order[j]] < w))
408 j--;
409
410 while (j >= 0 && (width[order[j]] == w) && (tally[order[j]] < t))
411 j--;
412
413 for (k = nentries - 1; k > j; k--)
414 order[k + 1] = order[k];
415
416 order[j + 1] = i;
417 nentries++;
418 }
419 }
420}
421
422
423void pack_table()

Callers 1

output_actionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected