network: simplify CheckNoZero

This commit is contained in:
Gabriel Ferreira
2021-08-07 14:30:43 -03:00
committed by Tom Henderson
parent 9b1d79dc51
commit bc42c61530

View File

@@ -812,14 +812,10 @@ bool
Buffer::Iterator::CheckNoZero (uint32_t start, uint32_t end) const
{
NS_LOG_FUNCTION (this << &start << &end);
for (uint32_t i = start; i < end; i++)
{
if (!Check (i))
{
return false;
}
}
return true;
return !(start < m_dataStart ||
end > m_dataEnd ||
(end > m_zeroStart && start < m_zeroEnd && m_zeroEnd != m_zeroStart && start != end)
);
}
bool
Buffer::Iterator::Check (uint32_t i) const