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 28, 2024
1 parent aaa7f8c commit 68424ce
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 @@ -1096,8 +1096,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 @@ -1123,8 +1122,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 @@ -1181,8 +1179,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 @@ -1206,8 +1203,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 @@ -1262,21 +1258,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 @@ -1323,21 +1306,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 68424ce

Please sign in to comment.