From d74ef8cb01de75c68e71d4c116a5508eadd8acc4 Mon Sep 17 00:00:00 2001 From: Lukas Tenbrink Date: Thu, 2 Jan 2025 16:48:54 +0100 Subject: [PATCH] Rename `LocalVector.invert()` -> `LocalVector.reverse()` to match the `Vector`, `String` and `List` APIs. --- core/templates/local_vector.h | 5 ++++- modules/navigation_2d/2d/nav_mesh_queries_2d.h | 8 ++++---- modules/navigation_3d/3d/nav_mesh_queries_3d.h | 8 ++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/core/templates/local_vector.h b/core/templates/local_vector.h index 547006d1915..0cbd42377f0 100644 --- a/core/templates/local_vector.h +++ b/core/templates/local_vector.h @@ -126,11 +126,14 @@ public: return occurrences; } - void invert() { + void reverse() { for (U i = 0; i < count / 2; i++) { SWAP(data[i], data[count - i - 1]); } } +#ifndef DISABLE_DEPRECATED + [[deprecated("Use reverse() instead")]] void invert() { reverse(); } +#endif _FORCE_INLINE_ void clear() { resize(0); } _FORCE_INLINE_ void reset() { diff --git a/modules/navigation_2d/2d/nav_mesh_queries_2d.h b/modules/navigation_2d/2d/nav_mesh_queries_2d.h index d15913ce484..0bb9ecd1a79 100644 --- a/modules/navigation_2d/2d/nav_mesh_queries_2d.h +++ b/modules/navigation_2d/2d/nav_mesh_queries_2d.h @@ -103,10 +103,10 @@ public: } void path_reverse() { - path_points.invert(); - path_meta_point_types.invert(); - path_meta_point_rids.invert(); - path_meta_point_owners.invert(); + path_points.reverse(); + path_meta_point_types.reverse(); + path_meta_point_rids.reverse(); + path_meta_point_owners.reverse(); } }; diff --git a/modules/navigation_3d/3d/nav_mesh_queries_3d.h b/modules/navigation_3d/3d/nav_mesh_queries_3d.h index ca9eea323f6..5f4854f9842 100644 --- a/modules/navigation_3d/3d/nav_mesh_queries_3d.h +++ b/modules/navigation_3d/3d/nav_mesh_queries_3d.h @@ -104,10 +104,10 @@ public: } void path_reverse() { - path_points.invert(); - path_meta_point_types.invert(); - path_meta_point_rids.invert(); - path_meta_point_owners.invert(); + path_points.reverse(); + path_meta_point_types.reverse(); + path_meta_point_rids.reverse(); + path_meta_point_owners.reverse(); } };