Skip to content

Commit 9baa34b

Browse files
N-Dekkerhjmjohnson
authored andcommitted
STYLE: Call GetTransformTypeAsString() just once, in TransformFactory
Instead of call it three times on the same transform. Also removed the `t` variable and replaced `1` with `true` as a `bool` argument.
1 parent c2b02ca commit 9baa34b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Modules/IO/TransformFactory/include/itkTransformFactory.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ class TransformFactory : public TransformFactoryBase
4848
static void
4949
RegisterTransform()
5050
{
51-
auto t = T::New();
51+
const std::string transformTypeAsString = T::New()->GetTransformTypeAsString();
5252

53-
TransformFactoryBase::Pointer f = TransformFactoryBase::GetFactory();
53+
const TransformFactoryBase::Pointer f = TransformFactoryBase::GetFactory();
5454

55-
f->RegisterTransform(t->GetTransformTypeAsString().c_str(),
56-
t->GetTransformTypeAsString().c_str(),
57-
t->GetTransformTypeAsString().c_str(),
58-
1,
55+
f->RegisterTransform(transformTypeAsString.c_str(),
56+
transformTypeAsString.c_str(),
57+
transformTypeAsString.c_str(),
58+
true,
5959
CreateObjectFunction<T>::New());
6060
}
6161
};

0 commit comments

Comments
 (0)