mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-23 21:13:35 +00:00
refactor(scope): simplify _findBindingResolver<T> with one-liner and optional chaining
The function is now shorter, more readable and uses modern Dart null-safety idioms. No functional change.
This commit is contained in:
@@ -258,11 +258,8 @@ class Scope with CycleDetectionMixin, GlobalCycleDetectionMixin {
|
||||
_parentScope?.tryResolveAsync(named: named, params: params);
|
||||
}
|
||||
|
||||
BindingResolver<T>? _findBindingResolver<T>(String? named) {
|
||||
final byType = _bindingResolvers[T];
|
||||
if (byType == null) return null;
|
||||
return byType[named] as BindingResolver<T>?;
|
||||
}
|
||||
BindingResolver<T>? _findBindingResolver<T>(String? named) =>
|
||||
_bindingResolvers[T]?[named] as BindingResolver<T>?;
|
||||
|
||||
// Индексируем все binding’и после каждого installModules/dropModules
|
||||
void _rebuildResolversIndex() {
|
||||
|
||||
Reference in New Issue
Block a user