diff options
author | qarmin <mikrutrafal54@gmail.com> | 2019-07-20 08:09:57 +0200 |
---|---|---|
committer | qarmin <mikrutrafal54@gmail.com> | 2019-07-20 08:09:57 +0200 |
commit | 6cbaf7662f5ee3ca1d02c0ebc85854fceee057af (patch) | |
tree | 9c6c688f72d0a6e2e79879be73e15adeb328d1b1 /core/math | |
parent | 584ca0f156cec64c259382895e105cf27566a987 (diff) |
Changed some code showed in LGTM and Coverage
Diffstat (limited to 'core/math')
-rw-r--r-- | core/math/bsp_tree.cpp | 4 | ||||
-rw-r--r-- | core/math/expression.cpp | 6 |
2 files changed, 3 insertions, 7 deletions
diff --git a/core/math/bsp_tree.cpp b/core/math/bsp_tree.cpp index a12f9fee2e..cfa698282e 100644 --- a/core/math/bsp_tree.cpp +++ b/core/math/bsp_tree.cpp @@ -192,7 +192,7 @@ int BSP_Tree::get_points_inside(const Vector3 *p_points, int p_point_count) cons #ifdef DEBUG_ENABLED int plane_count = planes.size(); uint16_t plane = nodesptr[idx].plane; - ERR_FAIL_INDEX_V(plane, plane_count, false); + ERR_FAIL_UNSIGNED_INDEX_V(plane, plane_count, false); #endif idx = planesptr[nodesptr[idx].plane].is_point_over(point) ? nodes[idx].over : nodes[idx].under; @@ -258,7 +258,7 @@ bool BSP_Tree::point_is_inside(const Vector3 &p_point) const { #ifdef DEBUG_ENABLED int plane_count = planes.size(); uint16_t plane = nodesptr[idx].plane; - ERR_FAIL_INDEX_V(plane, plane_count, false); + ERR_FAIL_UNSIGNED_INDEX_V(plane, plane_count, false); #endif bool over = planesptr[nodesptr[idx].plane].is_point_over(p_point); diff --git a/core/math/expression.cpp b/core/math/expression.cpp index b52658e2cf..fb25fd9e0f 100644 --- a/core/math/expression.cpp +++ b/core/math/expression.cpp @@ -793,17 +793,13 @@ Error Expression::_get_token(Token &r_token) { #define GET_CHAR() (str_ofs >= expression.length() ? 0 : expression[str_ofs++]) CharType cchar = GET_CHAR(); - if (cchar == 0) { - r_token.type = TK_EOF; - return OK; - } switch (cchar) { case 0: { r_token.type = TK_EOF; return OK; - } break; + }; case '{': { r_token.type = TK_CURLY_BRACKET_OPEN; |