From 5a0701252397960dd3b8a060a33201b66e1fbbcf Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 7 Jul 2025 20:37:48 +0200 Subject: [PATCH] Make these const to allow optimizations --- indra/newview/fsgridhandler.cpp | 11 +++++------ indra/newview/fsgridhandler.h | 11 +++++------ indra/newview/llviewernetwork.cpp | 4 ++-- indra/newview/llviewernetwork.h | 12 ++++++------ 4 files changed, 18 insertions(+), 20 deletions(-) diff --git a/indra/newview/fsgridhandler.cpp b/indra/newview/fsgridhandler.cpp index b4c4a8efa4..cfb39e5e5e 100644 --- a/indra/newview/fsgridhandler.cpp +++ b/indra/newview/fsgridhandler.cpp @@ -47,7 +47,6 @@ #else #include #endif -#include "llstartup.h" #include "fscorehttputil.h" #include "fspanellogin.h" @@ -1253,31 +1252,31 @@ void LLGridManager::updateIsInProductionGrid() } // For any Second Life grid -bool LLGridManager::isInSecondLife() +bool LLGridManager::isInSecondLife() const { return (EGridPlatform == GP_SLMAIN || EGridPlatform == GP_SLBETA); } // For Agni -bool LLGridManager::isInSLMain() +bool LLGridManager::isInSLMain() const { return (EGridPlatform == GP_SLMAIN); } // For Aditi -bool LLGridManager::isInSLBeta() +bool LLGridManager::isInSLBeta() const { return (EGridPlatform == GP_SLBETA); } // For OpenSim -bool LLGridManager::isInOpenSim() +bool LLGridManager::isInOpenSim() const { return (EGridPlatform == GP_OPENSIM || EGridPlatform == GP_AURORA); } // For Aurora Sim -bool LLGridManager::isInAuroraSim() +bool LLGridManager::isInAuroraSim() const { return (EGridPlatform == GP_AURORA); } diff --git a/indra/newview/fsgridhandler.h b/indra/newview/fsgridhandler.h index f249c9ece8..7071bd5be5 100644 --- a/indra/newview/fsgridhandler.h +++ b/indra/newview/fsgridhandler.h @@ -232,13 +232,12 @@ public: boost::signals2::connection addGridListChangedCallback(grid_list_changed_callback_t cb); grid_list_changed_signal_t mGridListChangedSignal; - bool isInSecondLife(); - bool isInSLMain(); - bool isInSLBeta(); - bool isInOpenSim(); - bool isInAuroraSim(); + bool isInSecondLife() const; + bool isInSLMain() const; + bool isInSLBeta() const; + bool isInOpenSim() const; + bool isInAuroraSim() const; void saveGridList(); - void clearFavorites(); void addGrid(GridEntry* grid_info, AddState state); void setClassifiedFee(const S32 classified_fee) { sClassifiedFee = classified_fee; } diff --git a/indra/newview/llviewernetwork.cpp b/indra/newview/llviewernetwork.cpp index 2506d3fcc7..8a5c3388b8 100644 --- a/indra/newview/llviewernetwork.cpp +++ b/indra/newview/llviewernetwork.cpp @@ -642,12 +642,12 @@ void LLGridManager::updateIsInProductionGrid() } } -bool LLGridManager::isInProductionGrid() +bool LLGridManager::isInProductionGrid() const { return mIsInProductionGrid; } -bool LLGridManager::isSystemGrid(const std::string& grid) +bool LLGridManager::isSystemGrid(const std::string& grid) const { std::string grid_name = getGrid(grid); diff --git a/indra/newview/llviewernetwork.h b/indra/newview/llviewernetwork.h index 98916f21a9..e9994fbf87 100644 --- a/indra/newview/llviewernetwork.h +++ b/indra/newview/llviewernetwork.h @@ -206,13 +206,13 @@ class LLGridManager : public LLSingleton //@} /// Is the given grid one of the hard-coded default grids (Agni or Aditi) - bool isSystemGrid(const std::string& grid); + bool isSystemGrid(const std::string& grid) const; /// Is the selected grid one of the hard-coded default grids (Agni or Aditi) - bool isSystemGrid() { return isSystemGrid(mGrid); } + bool isSystemGrid() const { return isSystemGrid(mGrid); } // /// Is the selected grid Second Life Main grid? - bool isInSLMain() { return isInProductionGrid(); } + bool isInSLMain() const { return isInProductionGrid(); } /** * the purpose of not just taking isInProductionGrid() is to * create merge conflicts so that changes that need special casing @@ -220,12 +220,12 @@ class LLGridManager : public LLSingleton */ /// Is the selected grid a Second Life beta grid? - bool isInSLBeta() { return (isSystemGrid() && !isInProductionGrid()); } - bool isInSecondLife() { return (isInSLMain() || isInSLBeta()); } // + bool isInSLBeta() const { return (isSystemGrid() && !isInProductionGrid()); } + bool isInSecondLife() const { return (isInSLMain() || isInSLBeta()); } // private: // /// Is the selected grid a production grid? - bool isInProductionGrid(); + bool isInProductionGrid() const; /** * yes, that's not a very helpful description. * I don't really know why that is different from isSystemGrid()