diff options
Diffstat (limited to 'src/lsp')
| -rw-r--r-- | src/lsp/server.zc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lsp/server.zc b/src/lsp/server.zc index 6a6c41b..afa8de4 100644 --- a/src/lsp/server.zc +++ b/src/lsp/server.zc @@ -3240,11 +3240,12 @@ int ca_add(char* owner, char* path, int from) { return 0; } // the fixes for every module that exports name, best first +word[32] ca_order; int ca_owners(char* name, int from) { - word p = run.export_owners(name), q = 0, next; - // ca_add prepends, so the list goes in backwards and comes out best first - while (p) { next = rt.new(2); next[0] = q; next[1] = p; q = next; p = p[0]; } - while (q) { p = q[1]; ca_add(p[1], p[2], from); next = q[0]; rt.free(q); q = next; } + word p = run.export_owners(name); int n = 0; + // ca_add prepends, so the owners go in backwards and come out best first + while (p && n < 32) { ca_order[n] = p; n++; p = p[0]; } + while (n > 0) { n--; p = ca_order[n]; ca_add(p[1], p[2], from); } return 0; } int ca_import_point(int i) { |
