From a9e944faa698f747448f556fd3320ecff8a97d97 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Wed, 3 Mar 2021 19:32:00 -0500
Subject: [PATCH] Reduce string temporaries

---
 indra/llfilesystem/llfilesystem.cpp  | 2 +-
 indra/llui/llxuiparser.cpp           | 2 +-
 indra/newview/llfloateruipreview.cpp | 2 +-
 indra/newview/llstartup.cpp          | 6 +++---
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/indra/llfilesystem/llfilesystem.cpp b/indra/llfilesystem/llfilesystem.cpp
index 039e7b2d8fc..77fd54a3736 100644
--- a/indra/llfilesystem/llfilesystem.cpp
+++ b/indra/llfilesystem/llfilesystem.cpp
@@ -206,7 +206,7 @@ S32 LLFileSystem::getSize()
 {
     S32 file_size = 0;
     llstat stat;
-    if (LLFile::stat(mFilePath.c_str(), &stat) == 0)
+    if (LLFile::stat(mFilePath, &stat) == 0)
     {
         file_size = stat.st_size;
     }
diff --git a/indra/llui/llxuiparser.cpp b/indra/llui/llxuiparser.cpp
index 9803789a1e8..6a8b1b7a666 100644
--- a/indra/llui/llxuiparser.cpp
+++ b/indra/llui/llxuiparser.cpp
@@ -637,7 +637,7 @@ void LLXUIXSDWriter::writeXSD(const std::string& type_name, const std::string& p
 		}
 	}
 
-	LLFILE* xsd_file = LLFile::fopen(file_name.c_str(), "w");
+	LLFILE* xsd_file = LLFile::fopen(file_name, "w");
 	LLXMLNode::writeHeaderToFile(xsd_file);
 	root_nodep->writeToFile(xsd_file);
 	fclose(xsd_file);
diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp
index 6029f6aba99..c841cdf1f6c 100644
--- a/indra/newview/llfloateruipreview.cpp
+++ b/indra/newview/llfloateruipreview.cpp
@@ -493,7 +493,7 @@ BOOL LLFloaterUIPreview::postBuild()
 		if((found = iter.next(language_directory)))							// get next directory
 		{
 			std::string full_path = gDirUtilp->add(xui_dir, language_directory);
-			if(LLFile::isfile(full_path.c_str()))																	// if it's not a directory, skip it
+			if(LLFile::isfile(full_path))																	// if it's not a directory, skip it
 			{
 				continue;
 			}
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 5fb23c97e2c..4455d9fe811 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -483,7 +483,7 @@ bool idle_startup()
 			if (!found_template)
 			{
 				message_template_path = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "app_settings", "message_template.msg");
-				found_template = LLFile::fopen(message_template_path.c_str(), "r");		/* Flawfinder: ignore */
+				found_template = LLFile::fopen(message_template_path, "r");		/* Flawfinder: ignore */
 			}	
 		#elif LL_DARWIN
 			// On Mac dev builds, message_template.msg lives in:
@@ -493,7 +493,7 @@ bool idle_startup()
 				message_template_path =
 					gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,
 												   "message_template.msg");
-				found_template = LLFile::fopen(message_template_path.c_str(), "r");		/* Flawfinder: ignore */
+				found_template = LLFile::fopen(message_template_path, "r");		/* Flawfinder: ignore */
 			}		
 		#endif
 
@@ -539,7 +539,7 @@ bool idle_startup()
 				// be located in indra/build-vc**/newview/<config>/app_settings.
 				std::string message_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"message.xml");
 							
-				if (!LLFile::isfile(message_path.c_str())) 
+				if (!LLFile::isfile(message_path)) 
 				{
 					LLMessageConfig::initClass("viewer", gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, "app_settings", ""));
 				}
-- 
GitLab