refactor(Core): apply clang-tidy modernize-pass-by-value (#3823)

This commit is contained in:
Francesco Borzì
2020-12-13 01:11:15 +01:00
committed by GitHub
parent 282966c117
commit adf436c937
10 changed files with 36 additions and 24 deletions

View File

@@ -10,9 +10,10 @@
#undef max
#include <cstdio>
#include <utility>
DBCFile::DBCFile(const std::string& filename):
filename(filename), recordSize(0), recordCount(0), fieldCount(0), stringSize(0), data(nullptr), stringTable(nullptr)
DBCFile::DBCFile(std::string filename):
filename(std::move(filename)), recordSize(0), recordCount(0), fieldCount(0), stringSize(0), data(nullptr), stringTable(nullptr)
{
}

View File

@@ -9,11 +9,12 @@
#include <cassert>
#include <string>
#include <utility>
class DBCFile
{
public:
DBCFile(const std::string& filename);
DBCFile(std::string filename);
~DBCFile();
// Open database. It must be openened before it can be used.
@@ -25,7 +26,7 @@ public:
class Exception
{
public:
Exception(const std::string& message): message(message)
Exception(std::string message): message(std::move(message))
{ }
virtual ~Exception() = default;
const std::string& getMessage() {return message;}

View File

@@ -4,14 +4,15 @@
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*/
#include "vmapexport.h"
#include "wmo.h"
#include "vec3d.h"
#include "vmapexport.h"
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <map>
#include <fstream>
#include <map>
#include <utility>
#undef min
#undef max
#include "mpq_libmpq04.h"
@@ -124,8 +125,8 @@ bool WMORoot::ConvertToVMAPRootWmo(FILE* pOutfile)
return true;
}
WMOGroup::WMOGroup(const std::string& filename) :
filename(filename), MOPY(nullptr), MOVI(nullptr), MoviEx(nullptr), MOVT(nullptr), MOBA(nullptr), MobaEx(nullptr),
WMOGroup::WMOGroup(std::string filename) :
filename(std::move(filename)), MOPY(nullptr), MOVI(nullptr), MoviEx(nullptr), MOVT(nullptr), MOBA(nullptr), MobaEx(nullptr),
hlq(nullptr), LiquEx(nullptr), LiquBytes(nullptr), groupName(0), descGroupName(0), mogpFlags(0),
moprIdx(0), moprNItems(0), nBatchA(0), nBatchB(0), nBatchC(0), fogIdx(0),
liquidType(0), groupWMOID(0), mopy_size(0), moba_size(0), LiquEx_size(0),

View File

@@ -98,7 +98,7 @@ public:
int nTriangles; // number when loaded
uint32 liquflags;
WMOGroup(std::string const& filename);
WMOGroup(std::string filename);
~WMOGroup();
bool open();