From 2840bff7734fc7888da804d7aad4e9f252f33872 Mon Sep 17 00:00:00 2001
From: brad kittenbrink <brad@lindenlab.com>
Date: Tue, 26 Apr 2011 15:10:39 -0700
Subject: FIX VWR-25610: LLControlCroup::loadFromFile makes unnecessary copies
 of large LLSD objects.

---
 indra/llxml/llcontrol.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

(limited to 'indra/llxml')

diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp
index 6e4364a20d..a604c1e631 100644
--- a/indra/llxml/llcontrol.cpp
+++ b/indra/llxml/llcontrol.cpp
@@ -839,7 +839,6 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v
 {
 	std::string name;
 	LLSD settings;
-	LLSD control_map;
 	llifstream infile;
 	infile.open(filename);
 	if(!infile.is_open())
@@ -864,7 +863,7 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v
 	{
 		bool persist = true;
 		name = (*itr).first;
-		control_map = (*itr).second;
+		LLSD const & control_map = (*itr).second;
 		
 		if(control_map.has("Persist")) 
 		{
-- 
cgit v1.2.3


From 42fe138cbb1af4acbb6851711f8c7f86c65795c0 Mon Sep 17 00:00:00 2001
From: brad kittenbrink <brad@lindenlab.com>
Date: Wed, 27 Apr 2011 19:13:17 -0700
Subject: Incorporated some suggestions from code review for VWR-25610

---
 indra/llxml/llcontrol.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'indra/llxml')

diff --git a/indra/llxml/llcontrol.cpp b/indra/llxml/llcontrol.cpp
index a604c1e631..0809d95628 100644
--- a/indra/llxml/llcontrol.cpp
+++ b/indra/llxml/llcontrol.cpp
@@ -837,7 +837,6 @@ U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only
 
 U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_values, bool save_values)
 {
-	std::string name;
 	LLSD settings;
 	llifstream infile;
 	infile.open(filename);
@@ -862,8 +861,8 @@ U32 LLControlGroup::loadFromFile(const std::string& filename, bool set_default_v
 	for(LLSD::map_const_iterator itr = settings.beginMap(); itr != settings.endMap(); ++itr)
 	{
 		bool persist = true;
-		name = (*itr).first;
-		LLSD const & control_map = (*itr).second;
+		std::string const & name = itr->first;
+		LLSD const & control_map = itr->second;
 		
 		if(control_map.has("Persist")) 
 		{
-- 
cgit v1.2.3