From 396027655ec4e4b52d8fa9cb5ca42dfccc11950b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= Date: Sat, 11 Jun 2016 15:48:57 +0300 Subject: [PATCH] Cleanup --- doomsday/apps/server/src/serversystem.cpp | 2 +- doomsday/sdk/libcore/src/data/reader.cpp | 8 ++++---- doomsday/sdk/libcore/src/scriptsys/scriptsystem.cpp | 6 ++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/doomsday/apps/server/src/serversystem.cpp b/doomsday/apps/server/src/serversystem.cpp index e0ef4ad543..5c0150b0bd 100644 --- a/doomsday/apps/server/src/serversystem.cpp +++ b/doomsday/apps/server/src/serversystem.cpp @@ -68,7 +68,7 @@ DENG2_PIMPL(ServerSystem) ListenSocket *serverSock = nullptr; - QMap users; + QHash users; ShellUsers shellUsers; Instance(Public *i) : Base(i) {} diff --git a/doomsday/sdk/libcore/src/data/reader.cpp b/doomsday/sdk/libcore/src/data/reader.cpp index d7b3231f6a..ced2b35e11 100644 --- a/doomsday/sdk/libcore/src/data/reader.cpp +++ b/doomsday/sdk/libcore/src/data/reader.cpp @@ -332,9 +332,9 @@ Reader &Reader::operator >> (IByteArray &byteArray) * because the destination byte array is not guaranteed to be * a memory buffer where you can copy the contents directly. */ - QScopedPointer data(new IByteArray::Byte[size]); + Block data(size); d->readBytes(data.data(), size); - byteArray.set(0, data.data(), size); + byteArray.set(0, data.dataConst(), size); return *this; } @@ -346,9 +346,9 @@ Reader &Reader::operator >> (FixedByteArray &fixedByteArray) * a memory buffer where you can copy the contents directly. */ dsize const size = fixedByteArray.size(); - QScopedPointer data(new IByteArray::Byte[size]); + Block data(size); d->readBytes(data.data(), size); - fixedByteArray.set(0, data.data(), size); + fixedByteArray.set(0, data.dataConst(), size); return *this; } diff --git a/doomsday/sdk/libcore/src/scriptsys/scriptsystem.cpp b/doomsday/sdk/libcore/src/scriptsys/scriptsystem.cpp index 28a975690d..c44e9d1bc3 100644 --- a/doomsday/sdk/libcore/src/scriptsys/scriptsystem.cpp +++ b/doomsday/sdk/libcore/src/scriptsys/scriptsystem.cpp @@ -156,13 +156,15 @@ DENG2_PIMPL(ScriptSystem) std::unique_ptr defaultImportPath(new ArrayValue); defaultImportPath->add(""); //defaultImportPath->add("*"); // Newest module with a matching name. - ArrayValue const *importPath = defaultImportPath.get(); + ArrayValue const *importPath; try { importPath = &App::config().geta("importPath"); } catch (Record::NotFoundError const &) - {} + { + importPath = defaultImportPath.get(); + } // Compile a list of all possible import locations. importPaths.clear();