mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-17 19:05:42 +00:00
refactor(src/common): remove unused imports (#19506)
* refactor(src/common): remove unused imports * fix: build * chore: fix build * chore: size_t -> std::size_t * chore: fix fuckup from previous commit * chore: fix build * chore: fix build * chore: fix build * chore: fix build with std::size_t * chore: fix build * chore: fix build * chore: fix build * chore: fix build * chore: fix build * chore: fix build * chore: fix build * chore: fix build * chore: fix build * chore: fix build * chore: fix build * chore: fix build
This commit is contained in:
@@ -151,11 +151,11 @@ bool DatabaseWorkerPool<T>::PrepareStatements()
|
||||
else
|
||||
connection->Unlock();
|
||||
|
||||
size_t const preparedSize = connection->m_stmts.size();
|
||||
std::size_t const preparedSize = connection->m_stmts.size();
|
||||
if (_preparedStatementSize.size() < preparedSize)
|
||||
_preparedStatementSize.resize(preparedSize);
|
||||
|
||||
for (size_t i = 0; i < preparedSize; ++i)
|
||||
for (std::size_t i = 0; i < preparedSize; ++i)
|
||||
{
|
||||
// already set by another connection
|
||||
// (each connection only has prepared statements of it's own type sync/async)
|
||||
@@ -485,7 +485,7 @@ void DatabaseWorkerPool<T>::Enqueue(SQLOperation* op)
|
||||
}
|
||||
|
||||
template <class T>
|
||||
size_t DatabaseWorkerPool<T>::QueueSize() const
|
||||
std::size_t DatabaseWorkerPool<T>::QueueSize() const
|
||||
{
|
||||
return _queue->Size();
|
||||
}
|
||||
|
||||
@@ -227,7 +227,7 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
[[nodiscard]] size_t QueueSize() const;
|
||||
[[nodiscard]] std::size_t QueueSize() const;
|
||||
|
||||
private:
|
||||
uint32 OpenConnections(InternalIndex type, uint8 numConnections);
|
||||
|
||||
@@ -144,7 +144,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
void Field::GetBinarySizeChecked(uint8* buf, size_t length) const
|
||||
void Field::GetBinarySizeChecked(uint8* buf, std::size_t length) const
|
||||
{
|
||||
ASSERT(data.value && (data.length == length), "Expected {}-byte binary blob, got {}data ({} bytes) instead", length, data.value ? "" : "no ", data.length);
|
||||
memcpy(buf, data.value, length);
|
||||
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
return GetDataBinary();
|
||||
}
|
||||
|
||||
template <typename T, size_t S>
|
||||
template <typename T, std::size_t S>
|
||||
inline std::enable_if_t<std::is_same_v<Binary, T>, std::array<uint8, S>> Get() const
|
||||
{
|
||||
std::array<uint8, S> buf = {};
|
||||
@@ -173,7 +173,7 @@ private:
|
||||
QueryResultFieldMetadata const* meta;
|
||||
void LogWrongType(std::string_view getter, std::string_view typeName) const;
|
||||
void SetMetadata(QueryResultFieldMetadata const* fieldMeta);
|
||||
void GetBinarySizeChecked(uint8* buf, size_t size) const;
|
||||
void GetBinarySizeChecked(uint8* buf, std::size_t size) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -464,7 +464,7 @@ int MySQLConnection::ExecuteTransaction(std::shared_ptr<TransactionBase> transac
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t MySQLConnection::EscapeString(char* to, const char* from, size_t length)
|
||||
std::size_t MySQLConnection::EscapeString(char* to, const char* from, std::size_t length)
|
||||
{
|
||||
return mysql_real_escape_string(m_Mysql, to, from, length);
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
void RollbackTransaction();
|
||||
void CommitTransaction();
|
||||
int ExecuteTransaction(std::shared_ptr<TransactionBase> transaction);
|
||||
size_t EscapeString(char* to, const char* from, size_t length);
|
||||
std::size_t EscapeString(char* to, const char* from, std::size_t length);
|
||||
void Ping();
|
||||
|
||||
uint32 GetLastError();
|
||||
|
||||
@@ -190,7 +190,7 @@ std::string MySQLPreparedStatement::getQueryString() const
|
||||
{
|
||||
std::string queryString(m_queryString);
|
||||
|
||||
size_t pos = 0;
|
||||
std::size_t pos = 0;
|
||||
|
||||
for (PreparedStatementData const& data : m_stmt->GetParameters())
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "PreparedStatement.h"
|
||||
#include "QueryResult.h"
|
||||
|
||||
bool SQLQueryHolderBase::SetPreparedQueryImpl(size_t index, PreparedStatementBase* stmt)
|
||||
bool SQLQueryHolderBase::SetPreparedQueryImpl(std::size_t index, PreparedStatementBase* stmt)
|
||||
{
|
||||
if (m_queries.size() <= index)
|
||||
{
|
||||
@@ -34,7 +34,7 @@ bool SQLQueryHolderBase::SetPreparedQueryImpl(size_t index, PreparedStatementBas
|
||||
return true;
|
||||
}
|
||||
|
||||
PreparedQueryResult SQLQueryHolderBase::GetPreparedResult(size_t index) const
|
||||
PreparedQueryResult SQLQueryHolderBase::GetPreparedResult(std::size_t index) const
|
||||
{
|
||||
// Don't call to this function if the index is of a prepared statement
|
||||
ASSERT(index < m_queries.size(), "Query holder result index out of range, tried to access index {} but there are only {} results",
|
||||
@@ -43,7 +43,7 @@ PreparedQueryResult SQLQueryHolderBase::GetPreparedResult(size_t index) const
|
||||
return m_queries[index].second;
|
||||
}
|
||||
|
||||
void SQLQueryHolderBase::SetPreparedResult(size_t index, PreparedResultSet* result)
|
||||
void SQLQueryHolderBase::SetPreparedResult(std::size_t index, PreparedResultSet* result)
|
||||
{
|
||||
if (result && !result->GetRowCount())
|
||||
{
|
||||
@@ -66,7 +66,7 @@ SQLQueryHolderBase::~SQLQueryHolderBase()
|
||||
}
|
||||
}
|
||||
|
||||
void SQLQueryHolderBase::SetSize(size_t size)
|
||||
void SQLQueryHolderBase::SetSize(std::size_t size)
|
||||
{
|
||||
/// to optimize push_back, reserve the number of queries about to be executed
|
||||
m_queries.resize(size);
|
||||
@@ -77,7 +77,7 @@ SQLQueryHolderTask::~SQLQueryHolderTask() = default;
|
||||
bool SQLQueryHolderTask::Execute()
|
||||
{
|
||||
/// execute all queries in the holder and pass the results
|
||||
for (size_t i = 0; i < m_holder->m_queries.size(); ++i)
|
||||
for (std::size_t i = 0; i < m_holder->m_queries.size(); ++i)
|
||||
if (PreparedStatementBase* stmt = m_holder->m_queries[i].first)
|
||||
m_holder->SetPreparedResult(i, m_conn->Query(stmt));
|
||||
|
||||
|
||||
@@ -28,12 +28,12 @@ friend class SQLQueryHolderTask;
|
||||
public:
|
||||
SQLQueryHolderBase() = default;
|
||||
virtual ~SQLQueryHolderBase();
|
||||
void SetSize(size_t size);
|
||||
PreparedQueryResult GetPreparedResult(size_t index) const;
|
||||
void SetPreparedResult(size_t index, PreparedResultSet* result);
|
||||
void SetSize(std::size_t size);
|
||||
PreparedQueryResult GetPreparedResult(std::size_t index) const;
|
||||
void SetPreparedResult(std::size_t index, PreparedResultSet* result);
|
||||
|
||||
protected:
|
||||
bool SetPreparedQueryImpl(size_t index, PreparedStatementBase* stmt);
|
||||
bool SetPreparedQueryImpl(std::size_t index, PreparedStatementBase* stmt);
|
||||
|
||||
private:
|
||||
std::vector<std::pair<PreparedStatementBase*, PreparedQueryResult>> m_queries;
|
||||
@@ -43,7 +43,7 @@ template<typename T>
|
||||
class SQLQueryHolder : public SQLQueryHolderBase
|
||||
{
|
||||
public:
|
||||
bool SetPreparedQuery(size_t index, PreparedStatement<T>* stmt)
|
||||
bool SetPreparedQuery(std::size_t index, PreparedStatement<T>* stmt)
|
||||
{
|
||||
return SetPreparedQueryImpl(index, stmt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user