From cb209c853fbbaec5e369e8eed4a22507d03e39e6 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 8 Apr 2012 00:19:24 -0700 Subject: [PATCH] Move these inline to be faster. --- Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp | 6 ------ Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.h | 9 +++++++-- Sources/Plasma/PubUtilLib/plResMgr/plPageInfo.cpp | 5 ----- Sources/Plasma/PubUtilLib/plResMgr/plPageInfo.h | 4 ++-- 4 files changed, 9 insertions(+), 15 deletions(-) diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp b/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp index 6b42e130..c5707d25 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp @@ -76,12 +76,6 @@ plLocation& plLocation::operator=(const plLocation& rhs) return *this; } -hsBool plLocation::operator==(const plLocation& u) const -{ - // Ignore the itinerant flag when comparing, because - return (fSequenceNumber == u.fSequenceNumber) && ((fFlags & ~kItinerant) == (u.fFlags & ~kItinerant)); -} - void plLocation::Set(uint32_t seqNum) { fSequenceNumber = seqNum; diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.h b/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.h index b8213a84..e6707e52 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.h +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.h @@ -89,7 +89,7 @@ protected: kNormalLocStartIdx = kLocalLocEndIdx + 1, - kReservedLocStart = 0xff000000, // Reserved locations are ones that aren't real game locations, + kReservedLocStart = 0xff000000, // Reserved locations are ones that aren't real game locations, kGlobalServerLocIdx = kReservedLocStart, // Global pool room for the server. Only the server gets this one kReservedLocAvailableStart = kGlobalServerLocIdx + 1, // This is the start of the *really* available ones @@ -119,7 +119,12 @@ public: void Read(hsStream* s); void Write(hsStream* s) const; - hsBool operator==(const plLocation& loc) const; + hsBool operator==(const plLocation& loc) const + { + // Ignore the itinerant flag when comparing, because + return (fSequenceNumber == loc.fSequenceNumber) && + ((fFlags & ~kItinerant) == (loc.fFlags & ~kItinerant)); + } hsBool operator!=(const plLocation& loc) const { return !(loc == *this); } plLocation& operator=(const plLocation& loc); bool operator<(const plLocation& loc ) const { return fSequenceNumber < loc.fSequenceNumber; } diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plPageInfo.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plPageInfo.cpp index 44da5ac1..f8da5e86 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plPageInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plPageInfo.cpp @@ -120,11 +120,6 @@ void plPageInfo::AddClassVersion(uint16_t classIdx, uint16_t version) fClassVersions.push_back(cv); } -const plLocation& plPageInfo::GetLocation() const -{ - return fLocation; -} - void plPageInfo::Read( hsStream *s ) { delete [] fAge; diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plPageInfo.h b/Sources/Plasma/PubUtilLib/plResMgr/plPageInfo.h index c3cce2e4..448a3b95 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plPageInfo.h +++ b/Sources/Plasma/PubUtilLib/plResMgr/plPageInfo.h @@ -65,7 +65,7 @@ protected: char* fPage; uint16_t fMajorVersion; ClassVerVec fClassVersions; - uint32_t fChecksum; + uint32_t fChecksum; uint32_t fDataStart, fIndexStart; void IInit( void ); @@ -90,7 +90,7 @@ public: void SetStrings( const char *age, const char *page ); void SetLocation(const plLocation& loc); - const plLocation& GetLocation() const; + const plLocation& GetLocation() const { return fLocation; } uint16_t GetMajorVersion() const { return fMajorVersion; } void SetMajorVersion(uint16_t major) { fMajorVersion = major; }