summaryrefslogtreecommitdiffstats
path: root/src/Rml.cpp
diff options
context:
space:
mode:
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;