From 4e27adc96b264851a8b7e29a1fadf5adb7eedf7e Mon Sep 17 00:00:00 2001 From: Thayne McCombs Date: Sun, 26 Jun 2016 21:00:15 -0600 Subject: [PATCH] Transpose static if to avoid generating dead code. --- source/poodinis/container.d | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/poodinis/container.d b/source/poodinis/container.d index fdc66ae..acfbb07 100644 --- a/source/poodinis/container.d +++ b/source/poodinis/container.d @@ -175,8 +175,8 @@ synchronized class DependencyContainer { auto newRegistration = new AutowiredRegistration!ConcreteType(registeredType, this); newRegistration.singleInstance(); - if (!hasOption(options, persistentRegistrationOptions, RegistrationOption.doNotAddConcreteTypeRegistration)) { - static if (!is(SuperType == ConcreteType)) { + static if (!is(SuperType == ConcreteType)) { + if (!hasOption(options, persistentRegistrationOptions, RegistrationOption.doNotAddConcreteTypeRegistration)) { auto concreteTypeRegistration = register!ConcreteType; concreteTypeRegistration.linkTo(newRegistration); }