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
refactor: optimize scheduler policy lookup with try/except pattern
Replace double dictionary lookup pattern with more efficient try/except
approach. This eliminates redundant key existence check and improves
performance by reducing dictionary access from two operations to one
in the success path.
Changes:
- Use try/except KeyError instead of 'in' check followed by access
- Add 'from None' to suppress exception chaining for cleaner error messages
- Maintain identical error handling behavior with ValueError for unknown policies
Signed-off-by: zitian.zhao <[email protected]>
0 commit comments