Commit 98c24b9
fix(rust-guard): remove write-only owner-type cache and simplify get_issue_author_association
Closes #4329
Two dead-code / duplication fixes in backend.rs:
1. Remove repo_owner_type_cache and set_cached_owner_is_org.
The cache was written to on every is_repo_private_with_callback call
but never read — no get_cached_owner_is_org exists anywhere in the
codebase. This wasted a Mutex acquisition and grew a HashMap
indefinitely without ever being consulted. The piggyback log line is
retained; only the cache write is dropped.
2. Replace the 35-line get_issue_author_association_with_callback body
with a one-liner that delegates to get_issue_author_info_with_callback.
Both functions made the identical issue_read call and parsed the same
fields; the only difference was that the info variant also extracted
author_login. Any future change to the issue_read fetch path now
needs to be made in exactly one place.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 8f964e0 commit 98c24b9
1 file changed
Lines changed: 3 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | 22 | | |
28 | 23 | | |
29 | 24 | | |
| |||
60 | 55 | | |
61 | 56 | | |
62 | 57 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 58 | | |
70 | 59 | | |
71 | 60 | | |
| |||
218 | 207 | | |
219 | 208 | | |
220 | 209 | | |
221 | | - | |
| 210 | + | |
222 | 211 | | |
223 | | - | |
224 | 212 | | |
225 | 213 | | |
226 | 214 | | |
| |||
347 | 335 | | |
348 | 336 | | |
349 | 337 | | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
| 338 | + | |
| 339 | + | |
378 | 340 | | |
379 | 341 | | |
380 | 342 | | |
| |||
0 commit comments