From ae451b7ae1037ecb66112188fdbc1716c500c0df Mon Sep 17 00:00:00 2001 From: Josh Pelkey Date: Thu, 16 Sep 2010 15:50:59 -0400 Subject: [PATCH] Bug 994 - PointToPointGridHelper useless if clauses --- src/helper/point-to-point-grid-helper.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/helper/point-to-point-grid-helper.cc b/src/helper/point-to-point-grid-helper.cc index 8a1bbaa21..d7a2c5cc8 100644 --- a/src/helper/point-to-point-grid-helper.cc +++ b/src/helper/point-to-point-grid-helper.cc @@ -178,8 +178,7 @@ PointToPointGridHelper::BoundingBox (double ulx, double uly, Ptr PointToPointGridHelper::GetNode (uint32_t row, uint32_t col) { - if (row < 0 || col < 0 || - row > m_nodes.size () - 1 || + if (row > m_nodes.size () - 1 || col > m_nodes.at (row).GetN () - 1) { NS_FATAL_ERROR ("Index out of bounds in PointToPointGridHelper::GetNode."); @@ -191,8 +190,7 @@ PointToPointGridHelper::GetNode (uint32_t row, uint32_t col) Ipv4Address PointToPointGridHelper::GetIpv4Address (uint32_t row, uint32_t col) { - if (row < 0 || col < 0 || - row > m_nodes.size () - 1 || + if (row > m_nodes.size () - 1 || col > m_nodes.at (row).GetN () - 1) { NS_FATAL_ERROR ("Index out of bounds in PointToPointGridHelper::GetIpv4Address.");