@@ -92,10 +92,10 @@ bool FSCommon::is_irc_me_prefix(std::string_view text)
9292std::string FSCommon::unescape_name (std::string_view name)
9393{
9494 // bugfix for SL-46920: preventing filenames that break stuff.
95- char * curl_str = curl_unescape (name.data (), static_cast <int >(name.size ())); // Calling data() should be ok here because we also pass the length
95+ char * curl_str = curl_unescape (name.data (), static_cast <int >(name.size ())); // Calling data() should be ok here because we also pass the length
9696 std::string unescaped_name (curl_str);
9797 curl_free (curl_str);
98- curl_str = NULL ;
98+ curl_str = nullptr ;
9999
100100 return unescaped_name;
101101}
@@ -301,11 +301,12 @@ bool FSCommon::isLinden(const LLUUID& av_id)
301301 if (LLGridManager::getInstance ()->isInOpenSim ())
302302 {
303303 LLViewerRegion* region = gAgent .getRegion ();
304- if (!region) return false ;
305- bool is_god = false ;
304+ if (!region)
305+ return false ;
306+
307+ bool is_god{ false };
306308 // <FS:CR> They may not be "Lindens" per se, but opensim has gods.
307- std::set<std::string> gods = region->getGods ();
308- if (!gods.empty ())
309+ if (std::set<std::string> gods = region->getGods (); !gods.empty ())
309310 {
310311 is_god = (gods.find (first_name + " " + last_name) != gods.end ()
311312 || gods.find (last_name) != gods.end ());
@@ -453,7 +454,7 @@ std::string FSCommon::getAvatarNameByDisplaySettings(const LLAvatarName& av_name
453454 std::string name;
454455 static LLCachedControl<bool > NameTagShowUsernames (gSavedSettings , " NameTagShowUsernames" );
455456 static LLCachedControl<bool > UseDisplayNames (gSavedSettings , " UseDisplayNames" );
456- if (( NameTagShowUsernames) && ( UseDisplayNames) )
457+ if (NameTagShowUsernames && UseDisplayNames)
457458 {
458459 name = av_name.getCompleteName ();
459460 }
@@ -494,21 +495,21 @@ bool FSCommon::isDefaultTexture(const LLUUID& asset_id)
494495
495496bool FSCommon::isLegacySkin ()
496497{
497- std::string current_skin = gSavedSettings .getString (" FSInternalSkinCurrent" );
498- return (current_skin == " Vintage " ) ;
498+ static bool is_legacy_skin = gSavedSettings .getString (" FSInternalSkinCurrent" ) == " Vintage " ;
499+ return is_legacy_skin ;
499500}
500501
501502bool FSCommon::isFilterEditorKeyCombo (KEY key, MASK mask)
502503{
503- return (mask == MASK_CONTROL && key == ' F' && gSavedSettings .getBOOL (" FSSelectLocalSearchEditorOnShortcut" ));
504+ static LLCachedControl<bool > select_search_on_shortcut (gSavedSettings , " FSSelectLocalSearchEditorOnShortcut" );
505+ return (mask == MASK_CONTROL && key == ' F' && select_search_on_shortcut);
504506}
505507
506508LLUUID FSCommon::getGroupForRezzing ()
507509{
508510 LLUUID group_id{ gAgent .getGroupID () };
509- LLParcel* parcel = LLViewerParcelMgr::getInstance ()->getAgentParcel ();
510511
511- if (parcel && gSavedSettings .getBOOL (" RezUnderLandGroup" ))
512+ if (LLParcel* parcel = LLViewerParcelMgr::getInstance ()-> getAgentParcel (); parcel && gSavedSettings .getBOOL (" RezUnderLandGroup" ))
512513 {
513514 // In both cases, group-owned or not, the group ID is the same;
514515 // No need to query the parcel owner ID as it will be either
0 commit comments