@@ -29,7 +29,7 @@ RRNodeId RRSpatialLookup::find_node(int x,
29
29
}
30
30
31
31
/* Pre-check: the x, y, side and ptc should be non negative numbers! Otherwise, return an invalid id */
32
- if ((0 > x ) || (0 > y ) || (NUM_SIDES == node_side ) || (0 > ptc )) {
32
+ if ((x < 0 ) || (y < 0 ) || (node_side == NUM_SIDES ) || (ptc < 0 )) {
33
33
return RRNodeId::INVALID ();
34
34
}
35
35
@@ -41,7 +41,7 @@ RRNodeId RRSpatialLookup::find_node(int x,
41
41
*/
42
42
size_t node_x = x;
43
43
size_t node_y = y;
44
- if (CHANX == type ) {
44
+ if (type == CHANX ) {
45
45
std::swap (node_x, node_y);
46
46
}
47
47
@@ -83,7 +83,7 @@ std::vector<RRNodeId> RRSpatialLookup::find_channel_nodes(int x,
83
83
std::vector<RRNodeId> channel_nodes;
84
84
85
85
/* Pre-check: the x, y, type are valid! Otherwise, return an empty vector */
86
- if ((0 > x || 0 > y ) && (CHANX == type || CHANY == type )) {
86
+ if ((x < 0 || y < 0 ) && (type == CHANX || type == CHANY )) {
87
87
return channel_nodes;
88
88
}
89
89
@@ -95,7 +95,7 @@ std::vector<RRNodeId> RRSpatialLookup::find_channel_nodes(int x,
95
95
*/
96
96
size_t node_x = x;
97
97
size_t node_y = y;
98
- if (CHANX == type ) {
98
+ if (type == CHANX ) {
99
99
std::swap (node_x, node_y);
100
100
}
101
101
@@ -194,8 +194,8 @@ void RRSpatialLookup::resize_nodes(int x,
194
194
* should ensure the fast look-up well organized
195
195
*/
196
196
VTR_ASSERT (type < rr_node_indices_.size ());
197
- VTR_ASSERT (0 <= x );
198
- VTR_ASSERT (0 <= y );
197
+ VTR_ASSERT (x >= 0 );
198
+ VTR_ASSERT (y >= 0 );
199
199
200
200
if ((x >= int (rr_node_indices_[type].dim_size (0 )))
201
201
|| (y >= int (rr_node_indices_[type].dim_size (1 )))
0 commit comments