Anonymous avatar Anonymous committed d5178b9

EXP-700 FIX SLPlugin(s) takes high CPU%
Reviewed by Richard.

Comments (0)

Files changed (1)

indra/llcommon/llsdserialize_xml.cpp

 		case ELEMENT_INTEGER:
 			{
 				S32 i;
+				// sscanf okay here with different locales - ints don't change for different locale settings like floats do.
 				if ( sscanf(mCurrentContent.c_str(), "%d", &i ) == 1 )
 				{	// See if sscanf works - it's faster
 					value = i;
 		
 		case ELEMENT_REAL:
 			{
-				F64 r;
-				if ( sscanf(mCurrentContent.c_str(), "%lf", &r ) == 1 )
-				{	// See if sscanf works - it's faster
-					value = r;
-				}
-				else
-				{
-					value = LLSD(mCurrentContent).asReal();
-				}
+				value = LLSD(mCurrentContent).asReal();
+				// removed since this breaks when locale has decimal separator that isn't '.'
+				// investigated changing local to something compatible each time but deemed higher
+				// risk that just using LLSD.asReal() each time.
+				//F64 r;
+				//if ( sscanf(mCurrentContent.c_str(), "%lf", &r ) == 1 )
+				//{	// See if sscanf works - it's faster
+				//	value = r;
+				//}
+				//else
+				//{
+				//	value = LLSD(mCurrentContent).asReal();
+				//}
 			}
 			break;
 		
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.