1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-02-03 18:08:14 +01:00

Codechange: Add 'const' to static variables, which are only initialised once.

This commit is contained in:
frosch
2025-04-27 16:35:43 +02:00
committed by frosch
parent 1900125c98
commit 61cec33be2
20 changed files with 34 additions and 34 deletions

View File

@@ -178,7 +178,7 @@ struct DumpTarget {
/** Dump nested object (or only its name if this instance is already known). */
template <typename S> void WriteStructT(std::string_view name, const S *s)
{
static size_t type_id = ++LastTypeId();
static const size_t type_id = ++LastTypeId();
if (s == nullptr) {
/* No need to dump nullptr struct. */
@@ -201,7 +201,7 @@ struct DumpTarget {
/** Dump nested object (or only its name if this instance is already known). */
template <typename S> void WriteStructT(std::string_view name, const std::deque<S> *s)
{
static size_t type_id = ++LastTypeId();
static const size_t type_id = ++LastTypeId();
if (s == nullptr) {
/* No need to dump nullptr struct. */