Skip to content

Commit

Permalink
Refs #20533: Removed unnecessary checks.
Browse files Browse the repository at this point in the history
Signed-off-by: adriancampo <adriancampo@eprosima.com>
  • Loading branch information
adriancampo committed Feb 29, 2024
1 parent 716fd8a commit 9cff98f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1099,8 +1099,7 @@ if (type_ids.type_identifier1()._d() == TI_PLAIN_ARRAY_SMALL)
if (type_ids.type_identifier2()._d() == TK_NONE)
{
EXPECT_EQ(type_ids.type_identifier1().array_sdefn().header().equiv_kind(), EK_BOTH);
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().array_sdefn().element_identifier() ||
element_type_ids.type_identifier2() == *type_ids.type_identifier1().array_sdefn().element_identifier());
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().array_sdefn().element_identifier());
}
else
{
Expand All @@ -1126,8 +1125,7 @@ else
if (type_ids.type_identifier2()._d() == TK_NONE)
{
EXPECT_EQ(type_ids.type_identifier1().array_ldefn().header().equiv_kind(), EK_BOTH);
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().array_ldefn().element_identifier() ||
element_type_ids.type_identifier2() == *type_ids.type_identifier1().array_ldefn().element_identifier());
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().array_ldefn().element_identifier());
}
else
{
Expand Down Expand Up @@ -1184,8 +1182,7 @@ if (type_ids.type_identifier1()._d() == TI_PLAIN_SEQUENCE_SMALL)
if (type_ids.type_identifier2()._d() == TK_NONE)
{
EXPECT_EQ(type_ids.type_identifier1().seq_sdefn().header().equiv_kind(), EK_BOTH);
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().seq_sdefn().element_identifier() ||
element_type_ids.type_identifier2() == *type_ids.type_identifier1().seq_sdefn().element_identifier());
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().seq_sdefn().element_identifier());
}
else
{
Expand All @@ -1209,8 +1206,7 @@ else
if (type_ids.type_identifier2()._d() == TK_NONE)
{
EXPECT_EQ(type_ids.type_identifier1().seq_ldefn().header().equiv_kind(), EK_BOTH);
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().seq_ldefn().element_identifier() ||
element_type_ids.type_identifier2() == *type_ids.type_identifier1().seq_ldefn().element_identifier());
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().seq_ldefn().element_identifier());
}
else
{
Expand Down Expand Up @@ -1265,21 +1261,8 @@ if (type_ids.type_identifier1()._d() == TI_PLAIN_MAP_SMALL)
if (type_ids.type_identifier2()._d() == TK_NONE)
{
EXPECT_EQ(type_ids.type_identifier1().map_sdefn().header().equiv_kind(), EK_BOTH);
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().map_sdefn().element_identifier() ||
element_type_ids.type_identifier2() == *type_ids.type_identifier1().map_sdefn().element_identifier());
EXPECT_TRUE(key_type_ids.type_identifier1() == *type_ids.type_identifier1().map_sdefn().key_identifier() ||
key_type_ids.type_identifier2() == *type_ids.type_identifier1().map_sdefn().key_identifier());
}
else if (EK_BOTH == type_ids.type_identifier1().map_sdefn().header().equiv_kind())
{
EXPECT_EQ(type_ids.type_identifier1().map_sdefn().header().equiv_kind(),
type_ids.type_identifier2().map_sdefn().header().equiv_kind());
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().map_sdefn().element_identifier() ||
element_type_ids.type_identifier2() == *type_ids.type_identifier1().map_sdefn().element_identifier());
EXPECT_TRUE((key_type_ids.type_identifier1() == *type_ids.type_identifier1().map_sdefn().key_identifier() &&
key_type_ids.type_identifier2() == *type_ids.type_identifier2().map_sdefn().key_identifier()) ||
(key_type_ids.type_identifier1() == *type_ids.type_identifier2().map_sdefn().key_identifier() &&
key_type_ids.type_identifier2() == *type_ids.type_identifier1().map_sdefn().key_identifier()));
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().map_sdefn().element_identifier());
EXPECT_TRUE(key_type_ids.type_identifier1() == *type_ids.type_identifier1().map_sdefn().key_identifier());
}
else
{
Expand Down Expand Up @@ -1326,21 +1309,8 @@ else
if (type_ids.type_identifier2()._d() == TK_NONE)
{
EXPECT_EQ(type_ids.type_identifier1().map_ldefn().header().equiv_kind(), EK_BOTH);
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().map_ldefn().element_identifier() ||
element_type_ids.type_identifier2() == *type_ids.type_identifier1().map_ldefn().element_identifier());
EXPECT_TRUE(key_type_ids.type_identifier1() == *type_ids.type_identifier1().map_ldefn().key_identifier() ||
key_type_ids.type_identifier2() == *type_ids.type_identifier1().map_ldefn().key_identifier());
}
else if (EK_BOTH == type_ids.type_identifier1().map_ldefn().header().equiv_kind())
{
EXPECT_EQ(type_ids.type_identifier1().map_ldefn().header().equiv_kind(),
type_ids.type_identifier2().map_ldefn().header().equiv_kind());
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().map_ldefn().element_identifier() ||
element_type_ids.type_identifier2() == *type_ids.type_identifier1().map_ldefn().element_identifier());
EXPECT_TRUE((key_type_ids.type_identifier1() == *type_ids.type_identifier1().map_ldefn().key_identifier() &&
key_type_ids.type_identifier2() == *type_ids.type_identifier2().map_ldefn().key_identifier()) ||
(key_type_ids.type_identifier1() == *type_ids.type_identifier2().map_ldefn().key_identifier() &&
key_type_ids.type_identifier2() == *type_ids.type_identifier1().map_ldefn().key_identifier()));
EXPECT_TRUE(element_type_ids.type_identifier1() == *type_ids.type_identifier1().map_ldefn().element_identifier());
EXPECT_TRUE(key_type_ids.type_identifier1() == *type_ids.type_identifier1().map_ldefn().key_identifier());
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ else
return;
}
EquivalenceKind equiv_kind_$map_name(map)$ = EK_BOTH;
if ( (EK_COMPLETE == key_identifier_$map_name(map)$->_d() || EK_COMPLETE == element_identifier_$map_name(map)$->_d()) ||
if ((EK_COMPLETE == key_identifier_$map_name(map)$->_d() || EK_COMPLETE == element_identifier_$map_name(map)$->_d()) ||
(TI_PLAIN_SEQUENCE_SMALL == element_identifier_$map_name(map)$->_d() && EK_COMPLETE == element_identifier_$map_name(map)$->seq_sdefn().header().equiv_kind()) ||
(TI_PLAIN_SEQUENCE_LARGE == element_identifier_$map_name(map)$->_d() && EK_COMPLETE == element_identifier_$map_name(map)$->seq_ldefn().header().equiv_kind()) ||
(TI_PLAIN_ARRAY_SMALL == element_identifier_$map_name(map)$->_d() && EK_COMPLETE == element_identifier_$map_name(map)$->array_sdefn().header().equiv_kind()) ||
Expand Down

0 comments on commit 9cff98f

Please sign in to comment.