summaryrefslogtreecommitdiff
path: root/src/blitter
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2021-04-01 09:03:12 +0100
committerGitHub <noreply@github.com>2021-04-01 10:03:12 +0200
commit591ea9862d89787c1013c341be919dcb3a83ba06 (patch)
tree5f137c0e5d671e80461dc0c4920b38af77c99933 /src/blitter
parent088964a09100651798c6eb8cfffcaf79f9b5987f (diff)
downloadopenttd-591ea9862d89787c1013c341be919dcb3a83ba06.tar.xz
Codechange: Suppress warnings when asserts are disabled (#8916)
Diffstat (limited to 'src/blitter')
-rw-r--r--src/blitter/factory.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/blitter/factory.hpp b/src/blitter/factory.hpp
index c76126fb5..94f3f9998 100644
--- a/src/blitter/factory.hpp
+++ b/src/blitter/factory.hpp
@@ -61,13 +61,14 @@ protected:
name(name), description(description)
{
if (usable) {
+ Blitters &blitters = GetBlitters();
+ assert(blitters.find(this->name) == blitters.end());
/*
* Only add when the blitter is usable. Do not bail out or
* do more special things since the blitters are always
* instantiated upon start anyhow and freed upon shutdown.
*/
- std::pair<Blitters::iterator, bool> P = GetBlitters().insert(Blitters::value_type(this->name, this));
- assert(P.second);
+ blitters.insert(Blitters::value_type(this->name, this));
} else {
DEBUG(driver, 1, "Not registering blitter %s as it is not usable", name);
}