cppcheck - defensive programming on i index check order
This commit is contained in:
parent
0980991e64
commit
b22c1dd0f7
1 changed files with 1 additions and 1 deletions
|
@ -500,7 +500,7 @@ public:
|
||||||
|
|
||||||
virtual String get_tooltip(const Point2 &p_pos) const {
|
virtual String get_tooltip(const Point2 &p_pos) const {
|
||||||
for (int i = 0; i < flag_rects.size(); i++) {
|
for (int i = 0; i < flag_rects.size(); i++) {
|
||||||
if (flag_rects[i].has_point(p_pos) && i < names.size()) {
|
if (i < names.size() && flag_rects[i].has_point(p_pos)) {
|
||||||
return names[i];
|
return names[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue