diff options
author | LaG1924 <12997935+LaG1924@users.noreply.github.com> | 2023-07-08 21:41:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-08 21:41:27 +0200 |
commit | a68f48ad526d0843eb451af0be7f119db5ff794e (patch) | |
tree | 3c539c9e7de841c6616f532dadb7c8c1ef552d95 /src/Rml.cpp | |
parent | Merge pull request #80 from LaG1924/ftr/better-water (diff) | |
parent | Fixed some errors detected by static analysis (diff) | |
download | AltCraft-a68f48ad526d0843eb451af0be7f119db5ff794e.tar AltCraft-a68f48ad526d0843eb451af0be7f119db5ff794e.tar.gz AltCraft-a68f48ad526d0843eb451af0be7f119db5ff794e.tar.bz2 AltCraft-a68f48ad526d0843eb451af0be7f119db5ff794e.tar.lz AltCraft-a68f48ad526d0843eb451af0be7f119db5ff794e.tar.xz AltCraft-a68f48ad526d0843eb451af0be7f119db5ff794e.tar.zst AltCraft-a68f48ad526d0843eb451af0be7f119db5ff794e.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Rml.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Rml.cpp b/src/Rml.cpp index f6fff44..7f114cd 100644 --- a/src/Rml.cpp +++ b/src/Rml.cpp @@ -161,7 +161,8 @@ bool RmlRenderInterface::GenerateTexture(Rml::TextureHandle& texture_handle, con } void RmlRenderInterface::ReleaseTexture(Rml::TextureHandle texture) { - textures.erase(textures.find(texture)); + if (auto it = textures.find(texture); it != textures.end()) + textures.erase(it); } void RmlRenderInterface::Update(unsigned int windowWidth, unsigned int windowHeight) { @@ -183,7 +184,7 @@ Rml::FileHandle RmlFileInterface::Open(const Rml::String& path) { handle.filePos = 0; if (handle.assetPtr != nullptr) - handles.insert(std::make_pair(fileId, handle)); + handles.try_emplace(fileId, handle); else fileId = 0; return fileId; |