Core: Some optimizations
- Declare some functions const - Fix some mem leak - Fix some resource leak - Remove unused variables and functions - Remove duplicate functions - Reduce the scope of some variables - Remove unused file --HG-- branch : trunk
This commit is contained in:
@@ -61,8 +61,8 @@ class InstanceSave
|
||||
/* A map corresponding to the InstanceId/MapId does not always exist.
|
||||
InstanceSave objects may be created on player logon but the maps are
|
||||
created and loaded only when a player actually enters the instance. */
|
||||
uint32 GetInstanceId() { return m_instanceid; }
|
||||
uint32 GetMapId() { return m_mapid; }
|
||||
uint32 GetInstanceId() const { return m_instanceid; }
|
||||
uint32 GetMapId() const { return m_mapid; }
|
||||
|
||||
/* Saved when the instance is generated for the first time */
|
||||
void SaveToDB();
|
||||
@@ -71,7 +71,7 @@ class InstanceSave
|
||||
|
||||
/* for normal instances this corresponds to max(creature respawn time) + X hours
|
||||
for raid/heroic instances this caches the global respawn time for the map */
|
||||
time_t GetResetTime() { return m_resetTime; }
|
||||
time_t GetResetTime() const { return m_resetTime; }
|
||||
void SetResetTime(time_t resetTime) { m_resetTime = resetTime; }
|
||||
time_t GetResetTimeForDB();
|
||||
|
||||
@@ -89,12 +89,12 @@ class InstanceSave
|
||||
/* instances cannot be reset (except at the global reset time)
|
||||
if there are players permanently bound to it
|
||||
this is cached for the case when those players are offline */
|
||||
bool CanReset() { return m_canReset; }
|
||||
bool CanReset() const { return m_canReset; }
|
||||
void SetCanReset(bool canReset) { m_canReset = canReset; }
|
||||
|
||||
/* currently it is possible to omit this information from this structure
|
||||
but that would depend on a lot of things that can easily change in future */
|
||||
Difficulty GetDifficulty() { return m_difficulty; }
|
||||
Difficulty GetDifficulty() const { return m_difficulty; }
|
||||
|
||||
typedef std::list<Player*> PlayerListType;
|
||||
typedef std::list<Group*> GroupListType;
|
||||
|
||||
Reference in New Issue
Block a user