diff options
| author | untodesu <kirill@untode.su> | 2025-09-11 13:48:31 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-09-11 13:48:31 +0500 |
| commit | aaed751bf4430bf4b9b30cef532b8753b9f639ce (patch) | |
| tree | 16bc751c272ba27ad53ec48dbdd3a6d9e6a8d4c2 /game/client/resource/texture_gui.cc | |
| parent | 96bd73ae020ecca1f94698744c77498a89ad19f7 (diff) | |
| download | voxelius-aaed751bf4430bf4b9b30cef532b8753b9f639ce.tar.bz2 voxelius-aaed751bf4430bf4b9b30cef532b8753b9f639ce.zip | |
Replace most of C strings with string_view
Diffstat (limited to 'game/client/resource/texture_gui.cc')
| -rw-r--r-- | game/client/resource/texture_gui.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/game/client/resource/texture_gui.cc b/game/client/resource/texture_gui.cc index 971e201..415845d 100644 --- a/game/client/resource/texture_gui.cc +++ b/game/client/resource/texture_gui.cc @@ -8,9 +8,9 @@ static emhash8::HashMap<std::string, resource_ptr<TextureGUI>> resource_map; template<> -resource_ptr<TextureGUI> resource::load<TextureGUI>(const char* name, unsigned int flags) +resource_ptr<TextureGUI> resource::load<TextureGUI>(std::string_view name, unsigned int flags) { - auto it = resource_map.find(name); + auto it = resource_map.find(std::string(name)); if(it != resource_map.cend()) { // Return an existing resource @@ -67,7 +67,7 @@ resource_ptr<TextureGUI> resource::load<TextureGUI>(const char* name, unsigned i new_resource->size.x = image->size.x; new_resource->size.y = image->size.y; - return resource_map.insert_or_assign(name, new_resource).first->second; + return resource_map.insert_or_assign(std::string(name), new_resource).first->second; } return nullptr; |
