Commit 8f5e302
committed
simplify: remove lazy toolsByName map - not needed for actual use cases
FindToolByName() is only called once per request at most (to find toolset ID
for dynamic enablement). The SDK handles tool dispatch after registration.
A simple linear scan over ~90 tools is trivially fast and avoids:
- sync.Once complexity
- Map allocation
- Premature optimization for non-existent 'repeated lookups'
The pre-computed maps we keep (toolsetIDSet, etc.) are justified because
they're used for filtering logic that runs on every request.1 parent ab67ed6 commit 8f5e302
2 files changed
+4
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
128 | | - | |
129 | | - | |
130 | 128 | | |
131 | 129 | | |
132 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | 30 | | |
36 | 31 | | |
37 | 32 | | |
| |||
68 | 63 | | |
69 | 64 | | |
70 | 65 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | 66 | | |
84 | 67 | | |
85 | 68 | | |
| |||
237 | 220 | | |
238 | 221 | | |
239 | 222 | | |
240 | | - | |
241 | | - | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
242 | 227 | | |
243 | 228 | | |
244 | 229 | | |
| |||
0 commit comments