summaryrefslogtreecommitdiff
path: root/src/driver.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-04-01 11:16:19 +0200
committerGitHub <noreply@github.com>2021-04-01 11:16:19 +0200
commitfece1c57cab1d148e15775f3e10ba474dcfc1360 (patch)
tree864829048f995a13c2ada0a6f731404a7de0bab7 /src/driver.cpp
parent9eb6c78a0245317f8dc68ad1034b66019e1bf14f (diff)
downloadopenttd-fece1c57cab1d148e15775f3e10ba474dcfc1360.tar.xz
Codechange: Suppress warnings when asserts are disabled (#8917)
Diffstat (limited to 'src/driver.cpp')
-rw-r--r--src/driver.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/driver.cpp b/src/driver.cpp
index 42520648f..cfda1d3d3 100644
--- a/src/driver.cpp
+++ b/src/driver.cpp
@@ -221,8 +221,9 @@ DriverFactoryBase::DriverFactoryBase(Driver::Type type, int priority, const char
strecpy(buf, GetDriverTypeName(type), lastof(buf));
strecpy(buf + 5, name, lastof(buf));
- std::pair<Drivers::iterator, bool> P = GetDrivers().insert(Drivers::value_type(buf, this));
- assert(P.second);
+ Drivers &drivers = GetDrivers();
+ assert(drivers.find(buf) == drivers.end());
+ drivers.insert(Drivers::value_type(buf, this));
}
/**