Commit f1fe7a4
authored
**Key optimizations:**
- Avoid multiple `isinstance` calls by caching `type(node)` in a variable and using identity checks against the expected types (`_ast_Name`, `_ast_Attribute`).
- This speeds up the type checks, since identity comparison is faster than repeated isinstance checks, and in this hot path, there are only two accepted types.
1 parent 66207b5 commit f1fe7a4
1 file changed
+9
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
68 | 69 | | |
69 | | - | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
0 commit comments