From aaed751bf4430bf4b9b30cef532b8753b9f639ce Mon Sep 17 00:00:00 2001 From: untodesu Date: Thu, 11 Sep 2025 13:48:31 +0500 Subject: Replace most of C strings with string_view --- game/shared/world/item_registry.hh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'game/shared/world/item_registry.hh') diff --git a/game/shared/world/item_registry.hh b/game/shared/world/item_registry.hh index 7cf3bd8..7508f2a 100644 --- a/game/shared/world/item_registry.hh +++ b/game/shared/world/item_registry.hh @@ -26,11 +26,11 @@ namespace world { class ItemInfoBuilder final { public: - explicit ItemInfoBuilder(const char* name); + explicit ItemInfoBuilder(std::string_view name); virtual ~ItemInfoBuilder(void) = default; public: - ItemInfoBuilder& set_texture(const char* texture); + ItemInfoBuilder& set_texture(std::string_view texture); ItemInfoBuilder& set_place_voxel(voxel_id place_voxel); public: @@ -50,8 +50,8 @@ extern std::vector> items; namespace world::item_registry { -ItemInfoBuilder& construct(const char* name); -ItemInfo* find(const char* name); +ItemInfoBuilder& construct(std::string_view name); +ItemInfo* find(std::string_view name); ItemInfo* find(const item_id item); } // namespace world::item_registry @@ -62,7 +62,7 @@ void purge(void); namespace world::item_registry { -std::uint64_t calcualte_checksum(void); +std::uint64_t calculate_checksum(void); } // namespace world::item_registry #endif // SHARED_ITEM_REGISTRY_HH -- cgit