diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2021-04-01 09:03:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-01 10:03:12 +0200 |
commit | 591ea9862d89787c1013c341be919dcb3a83ba06 (patch) | |
tree | 5f137c0e5d671e80461dc0c4920b38af77c99933 /src/blitter | |
parent | 088964a09100651798c6eb8cfffcaf79f9b5987f (diff) | |
download | openttd-591ea9862d89787c1013c341be919dcb3a83ba06.tar.xz |
Codechange: Suppress warnings when asserts are disabled (#8916)
Diffstat (limited to 'src/blitter')
-rw-r--r-- | src/blitter/factory.hpp | 5 |
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); } |