Skip to content

Commit eb52759

Browse files
Removed warning (#4693) (#4704)
* Removed warning Signed-off-by: Alejandro Hernández Cordero <[email protected]> * Added suggestions Signed-off-by: Alejandro Hernández Cordero <[email protected]> --------- Signed-off-by: Alejandro Hernández Cordero <[email protected]> (cherry picked from commit 8258507) Co-authored-by: Alejandro Hernández Cordero <[email protected]>
1 parent 6582ec5 commit eb52759

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/cpp/fastdds/core/policy/ParameterList.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ bool ParameterList::read_guid_from_cdr_msg(
117117
fastrtps::rtps::GUID_t& guid)
118118
{
119119
bool valid = false;
120-
uint16_t pid;
121-
uint16_t plength;
120+
uint16_t pid = 0;
121+
uint16_t plength = 0;
122122
while (msg.pos < msg.length)
123123
{
124124
valid = true;
125125
valid &= fastrtps::rtps::CDRMessage::readUInt16(&msg, &pid);
126126
valid &= fastrtps::rtps::CDRMessage::readUInt16(&msg, &plength);
127-
if ((pid == PID_SENTINEL) || !valid)
127+
if (!valid || (pid == PID_SENTINEL))
128128
{
129129
break;
130130
}

0 commit comments

Comments
 (0)