diff options
| author | Richard Linden <none@none> | 2012-07-25 20:08:17 -0700 | 
|---|---|---|
| committer | Richard Linden <none@none> | 2012-07-25 20:08:17 -0700 | 
| commit | 88f259f7c1aefea197ae8b6c49a79de09feebf5b (patch) | |
| tree | 613301f3b0727be99cd5a6db73140effc7026811 /indra | |
| parent | 69b57d4ac075db855d88c2ff0e8c580e9e41ebf7 (diff) | |
optimization of LLSD param parsing
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/llui/llsdparam.cpp | 14 | 
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/llui/llsdparam.cpp b/indra/llui/llsdparam.cpp index 5a0d688f4f..54c8389772 100644 --- a/indra/llui/llsdparam.cpp +++ b/indra/llui/llsdparam.cpp @@ -305,6 +305,12 @@ namespace LLInitParam  	// block param interface  	bool ParamValue<LLSD, NOT_BLOCK>::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack, bool new_name)  	{ +		if (name_stack.first == name_stack.second +			&& p.readValue<LLSD>(mValue)) +		{ +			return true; +		} +  		LLSD& sd = LLParamSDParserUtilities::getSDWriteNode(mValue, name_stack);  		LLSD::String string; @@ -325,7 +331,11 @@ namespace LLInitParam  	void ParamValue<LLSD, NOT_BLOCK>::serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const BaseBlock* diff_block) const  	{ -		// read from LLSD value and serialize out to parser (which could be LLSD, XUI, etc) -		LLParamSDParserUtilities::readSDValues(boost::bind(&serializeElement, boost::ref(p), _1, _2), mValue, name_stack); +		// attempt to write LLSD out directly +		if (!p.writeValue<LLSD>(mValue, name_stack)) +		{ +			// otherwise read from LLSD value and serialize out to parser (which could be LLSD, XUI, etc) +			LLParamSDParserUtilities::readSDValues(boost::bind(&serializeElement, boost::ref(p), _1, _2), mValue, name_stack); +		}  	}  }  | 
