Skip to content

Commit b87cdea

Browse files
committed
clean up
1 parent 3125b9f commit b87cdea

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/db/LuaDB.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "LuaDB.h"
66
#include "../kcd2/IConsole.h"
77
#include "../kcd2/IGame.h"
8-
#include <optional>
98
#include <ranges>
109
#include <sstream>
1110
#include <unordered_set>
@@ -156,7 +155,7 @@ void CheckAndVacuum(SQLite::Database& db)
156155
}
157156

158157
// Database.cpp 优化版本
159-
LuaDB::LuaDB(SSystemGlobalEnvironment* env) :
158+
LuaDB::LuaDB(const SSystemGlobalEnvironment* env) :
160159
m_db(std::make_unique<SQLite::Database>("./kcd2db.db", SQLite::OPEN_READWRITE | SQLite::OPEN_CREATE)),
161160
m_lastSaveTime(std::chrono::steady_clock::now())
162161
{

src/db/LuaDB.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class ScriptValue {
9494

9595
class LuaDB final : public CScriptableBase, public IGameFrameworkListener {
9696
public:
97-
explicit LuaDB(SSystemGlobalEnvironment* env);
97+
explicit LuaDB(const SSystemGlobalEnvironment* env);
9898

9999
// Lua API
100100
int Set(IFunctionHandler* pH) { return GenericAccess(pH, AccessType::Set); }

src/log/log.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ void Log_init()
146146
{
147147
const auto now = std::chrono::system_clock::now();
148148
const std::time_t t = std::chrono::system_clock::to_time_t(now);
149-
std::tm tm;
149+
std::tm tm{};
150150
localtime_s(&tm, &t);
151151
out << "\nLog initialized at " << std::put_time(&tm, "%F %T") << '\n';
152152
}

0 commit comments

Comments
 (0)