[apps/sequence/sequence] Simplify isEmpty

This commit is contained in:
Ruben Dashyan
2019-09-06 13:31:58 +02:00
committed by LeaNumworks
parent 9a3ce0df26
commit 94f89f37d7

View File

@@ -104,14 +104,11 @@ bool Sequence::isDefined() {
bool Sequence::isEmpty() {
RecordDataBuffer * data = recordData();
switch (type()) {
case Type::Explicit:
return Function::isEmpty();
case Type::SingleRecurrence:
return Function::isEmpty() && data->initialConditionSize(0) == 0;
default:
return Function::isEmpty() && data->initialConditionSize(0) == 0 && data->initialConditionSize(1) == 0;
}
Type type = data->type();
return Function::isEmpty() &&
(type == Type::Explicit ||
(data->initialConditionSize(0) == 0 &&
(type == Type::SingleRecurrence || data->initialConditionSize(1) == 0)));
}
template<typename T>