message: perf(core): Avoid unnecessary creating provider factory
  In providerToRecord move creating the factory into a condition which
  actually needs it to avoid unnecessary creating it
  PR Close
diff: @@ -461,10 +461,10 @@ function getUndecoratedInjectableFactory(token: Function) {
  function providerToRecord(
  provider: SingleProvider, ngModuleType: InjectorType<any>, providers: any[]): Record<any> {
  - let factory: (() => any)|undefined = providerToFactory(provider, ngModuleType, providers);
  if (isValueProvider(provider)) {
  return makeRecord(undefined, provider.useValue);
  } else {
  + const factory: (() => any)|undefined = providerToFactory(provider, ngModuleType, providers);
  return makeRecord(factory, NOT_YET);
  }
  }
  