feat(Core/Misc): remove ACE Auto_Ptr (#3454)

This commit is contained in:
Kargatum
2020-11-23 08:10:33 +07:00
committed by GitHub
parent 2e3c98df94
commit 37ba988409
7 changed files with 13 additions and 57 deletions

View File

@@ -300,7 +300,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff)
void Item::SaveToDB(SQLTransaction& trans)
{
bool isInTransaction = !(trans.null());
bool isInTransaction = static_cast<bool>(trans);
if (!isInTransaction)
trans = CharacterDatabase.BeginTransaction();
@@ -1135,12 +1135,11 @@ void Item::SaveRefundDataToDB()
void Item::DeleteRefundDataFromDB(SQLTransaction* trans)
{
if (trans && !trans->null())
if (trans)
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ITEM_REFUND_INSTANCE);
stmt->setUInt32(0, GetGUIDLow());
(*trans)->Append(stmt);
}
}

View File

@@ -7514,7 +7514,7 @@ void Player::ModifyHonorPoints(int32 value, SQLTransaction* trans /*=NULL*/)
newValue = 0;
SetHonorPoints(uint32(newValue));
if (trans && !trans->null())
if (trans)
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_HONOR_POINTS);
stmt->setUInt32(0, newValue);
@@ -7530,7 +7530,7 @@ void Player::ModifyArenaPoints(int32 value, SQLTransaction* trans /*=NULL*/)
newValue = 0;
SetArenaPoints(uint32(newValue));
if (trans && !trans->null())
if (trans)
{
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UDP_CHAR_ARENA_POINTS);
stmt->setUInt32(0, newValue);
@@ -20125,7 +20125,7 @@ void Player::_SaveMail(SQLTransaction& trans)
void Player::_SaveQuestStatus(SQLTransaction& trans)
{
bool isTransaction = !trans.null();
bool isTransaction = static_cast<bool>(trans);
if (!isTransaction)
trans = CharacterDatabase.BeginTransaction();

View File

@@ -12,17 +12,17 @@
#include "Weather.h"
#include "Log.h"
#include "ObjectMgr.h"
#include "AutoPtr.h"
#include "Player.h"
#include "WorldPacket.h"
#include "WorldSession.h"
#include <memory>
namespace WeatherMgr
{
namespace
{
typedef std::unordered_map<uint32, acore::AutoPtr<Weather, ACE_Null_Mutex> > WeatherMap;
typedef std::unordered_map<uint32, std::unique_ptr<Weather>> WeatherMap;
typedef std::unordered_map<uint32, WeatherData> WeatherZoneMap;
WeatherMap m_weathers;