summaryrefslogtreecommitdiffstats
path: root/src/Rml.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2023-07-08 21:41:27 +0200
committerGitHub <noreply@github.com>2023-07-08 21:41:27 +0200
commita68f48ad526d0843eb451af0be7f119db5ff794e (patch)
tree3c539c9e7de841c6616f532dadb7c8c1ef552d95 /src/Rml.cpp
parentMerge pull request #80 from LaG1924/ftr/better-water (diff)
parentFixed some errors detected by static analysis (diff)
downloadAltCraft-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 'src/Rml.cpp')
-rw-r--r--src/Rml.cpp5
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;