You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
staticinlinevoidyacli_cmd_dump_path(yacli*cli,cmnode*n) { // {{{ print the root→n path (space-separated), no trailing space; iterative to avoid recursing up the parent chain
1857
+
intdepth=0,i;
1858
+
cmnode*p;
1859
+
1860
+
for (p=n;p;p=p->parent) // count depth
1861
+
depth++;
1862
+
while (depth>0) {
1863
+
depth--;
1864
+
p=n;
1865
+
for (i=0;i<depth;i++) // re-walk to the i-th ancestor; O(depth^2) but depth is tiny in practice and avoids any recursion or auxiliary storage
0 commit comments