| 13857 | // performed by this function. To prepare the shifts, we have to adjust |
| 13858 | // change(w+), shift(w+), and change(w-). |
| 13859 | function executeShifts(v) { |
| 13860 | var shift = 0, |
| 13861 | change = 0, |
| 13862 | children = v.children, |
| 13863 | i = children.length, |
| 13864 | w; |
| 13865 | while (--i >= 0) { |
| 13866 | w = children[i]; |
| 13867 | w.z += shift; |
| 13868 | w.m += shift; |
| 13869 | shift += w.s + (change += w.c); |
| 13870 | } |
| 13871 | } |
| 13872 | |
| 13873 | // If vi-’s ancestor is a sibling of v, returns vi-’s ancestor. Otherwise, |
| 13874 | // returns the specified (default) ancestor. |