From ffacba71e2d37a200137a4b4c34ad696b44ff781 Mon Sep 17 00:00:00 2001 From: orange Date: Wed, 11 Mar 2026 14:31:45 +0300 Subject: [PATCH] changed to string view --- include/omath/pathfinding/navigation_mesh.hpp | 2 +- source/pathfinding/navigation_mesh.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/omath/pathfinding/navigation_mesh.hpp b/include/omath/pathfinding/navigation_mesh.hpp index 882062e..7111597 100644 --- a/include/omath/pathfinding/navigation_mesh.hpp +++ b/include/omath/pathfinding/navigation_mesh.hpp @@ -31,7 +31,7 @@ namespace omath::pathfinding bool empty() const; // Events -- per-vertex optional tag (e.g. "jump", "teleport") - void set_event(const Vector3& vertex, std::string event_id); + void set_event(const Vector3& vertex, const std::string_view& event_id); void clear_event(const Vector3& vertex); [[nodiscard]] diff --git a/source/pathfinding/navigation_mesh.cpp b/source/pathfinding/navigation_mesh.cpp index 380f83e..345c490 100644 --- a/source/pathfinding/navigation_mesh.cpp +++ b/source/pathfinding/navigation_mesh.cpp @@ -30,12 +30,12 @@ namespace omath::pathfinding return m_vertex_map.empty(); } - void NavigationMesh::set_event(const Vector3& vertex, std::string event_id) + void NavigationMesh::set_event(const Vector3& vertex, const std::string_view& event_id) { if (!m_vertex_map.contains(vertex)) throw std::invalid_argument(std::format("Vertex '{}' not found", vertex)); - m_vertex_events[vertex] = std::move(event_id); + m_vertex_events[vertex] = event_id; } void NavigationMesh::clear_event(const Vector3& vertex)