From 8c9da6f5175e6356a5b9f30aa192266bb6ed3230 Mon Sep 17 00:00:00 2001 From: puzl Date: Wed, 29 Jun 2005 20:54:44 +0000 Subject: [PATCH] Performance Changes: Removed the passing by value of large objects git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@222 67975925-1194-0748-b3d5-c16f83f1a3a1 --- dev/performance-3.0.5/source/mod/AvHEntities.cpp | 2 +- dev/performance-3.0.5/source/mod/AvHEntities.h | 2 +- dev/performance-3.0.5/source/mod/AvHGamerules.cpp | 2 +- dev/performance-3.0.5/source/mod/AvHGamerules.h | 2 +- dev/performance-3.0.5/source/mod/AvHPlayer.cpp | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dev/performance-3.0.5/source/mod/AvHEntities.cpp b/dev/performance-3.0.5/source/mod/AvHEntities.cpp index b350782..b0e8f15 100644 --- a/dev/performance-3.0.5/source/mod/AvHEntities.cpp +++ b/dev/performance-3.0.5/source/mod/AvHEntities.cpp @@ -796,7 +796,7 @@ void AvHMP3Audio::ClearSoundNameList() sSoundList.clear(); } -StringList AvHMP3Audio::GetSoundNameList() +const StringList& AvHMP3Audio::GetSoundNameList() { return sSoundList; } diff --git a/dev/performance-3.0.5/source/mod/AvHEntities.h b/dev/performance-3.0.5/source/mod/AvHEntities.h index 3c12b0e..a468bb8 100644 --- a/dev/performance-3.0.5/source/mod/AvHEntities.h +++ b/dev/performance-3.0.5/source/mod/AvHEntities.h @@ -259,7 +259,7 @@ public: void EXPORT SpecialSoundUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value ); static void ClearSoundNameList(); - static StringList GetSoundNameList(); + static const StringList& GetSoundNameList(); private: static StringList sSoundList; diff --git a/dev/performance-3.0.5/source/mod/AvHGamerules.cpp b/dev/performance-3.0.5/source/mod/AvHGamerules.cpp index b615829..e00c637 100644 --- a/dev/performance-3.0.5/source/mod/AvHGamerules.cpp +++ b/dev/performance-3.0.5/source/mod/AvHGamerules.cpp @@ -1368,7 +1368,7 @@ bool AvHGamerules::GetCanJoinTeamInFuture(AvHPlayer* inPlayer, AvHTeamNumber inT return theCanJoinTeam; } -AvHBaseInfoLocationListType AvHGamerules::GetInfoLocations() const +const AvHBaseInfoLocationListType& AvHGamerules::GetInfoLocations() const { return mInfoLocations; } diff --git a/dev/performance-3.0.5/source/mod/AvHGamerules.h b/dev/performance-3.0.5/source/mod/AvHGamerules.h index c888c12..c919bf0 100644 --- a/dev/performance-3.0.5/source/mod/AvHGamerules.h +++ b/dev/performance-3.0.5/source/mod/AvHGamerules.h @@ -226,7 +226,7 @@ public: bool GetIsTesting(void) const; bool GetIsValidFutureTeam(AvHPlayer inPlayer, int inTeamNumber) const; bool GetCanJoinTeamInFuture(AvHPlayer* inPlayer, AvHTeamNumber theTeamNumber, string& outString) const; - AvHBaseInfoLocationListType GetInfoLocations() const; + const AvHBaseInfoLocationListType& GetInfoLocations() const; int GetMaxWeight(void) const; const char* GetSpawnEntityName(AvHPlayer* inPlayer) const; Vector GetSpawnAreaCenter(AvHTeamNumber inTeamNumber) const; diff --git a/dev/performance-3.0.5/source/mod/AvHPlayer.cpp b/dev/performance-3.0.5/source/mod/AvHPlayer.cpp index 1dbed83..41868a3 100644 --- a/dev/performance-3.0.5/source/mod/AvHPlayer.cpp +++ b/dev/performance-3.0.5/source/mod/AvHPlayer.cpp @@ -10285,7 +10285,7 @@ void AvHPlayer::UpdateParticleTemplates() void AvHPlayer::UpdateInfoLocations() { // Get map location list - AvHBaseInfoLocationListType theInfoLocations = GetGameRules()->GetInfoLocations(); + const AvHBaseInfoLocationListType& theInfoLocations = GetGameRules()->GetInfoLocations(); // Compare with ours, send one down each tick (assumes that previous ones sent don't change) int theNumClientInfoLocations = this->mClientInfoLocations.size(); @@ -10533,7 +10533,7 @@ void AvHPlayer::UpdateSoundNames() if(this->pev != NULL ) // Not fully connected yet { // Send list of special sounds - StringList theSoundNameList = AvHMP3Audio::GetSoundNameList(); + const StringList& theSoundNameList = AvHMP3Audio::GetSoundNameList(); int theNumberOfSounds = theSoundNameList.size(); int theNumberOfSoundsOnClient = this->mClientSoundNames.size();