7 * reorder the tuple to put x's line first in the entry and x first in its line
10 ndbreorder(Ndbtuple *t, Ndbtuple *x)
13 Ndbtuple *last, *prev;
15 /* if x is first, we're done */
19 /* find end of x's line */
20 for(last = x; last->line == last->entry; last = last->line)
23 /* rotate to make this line first */
26 /* detach this line and everything after it from the entry */
27 for(nt = t; nt->entry != last->line; nt = nt->entry)
32 for(nt = last; nt->entry != nil; nt = nt->entry)
37 /* rotate line to make x first */
40 /* find entry before x */
41 for(prev = last; prev->line != x; prev = prev->line);
46 last->entry = last->line;