Browse Source

Removed a bit of redundant code from earlier id [CS] change.

Frank Becker 14 years ago
parent
commit
2a6feca61b
2 changed files with 2 additions and 7 deletions
  1. 1 3
      Source/Core/Context.cpp
  2. 1 4
      Source/Core/ElementUtilities.cpp

+ 1 - 3
Source/Core/Context.cpp

@@ -425,15 +425,13 @@ void Context::ShowMouseCursor(bool show)
 // Returns the first document found in the root with the given id.
 // Returns the first document found in the root with the given id.
 ElementDocument* Context::GetDocument(const String& id)
 ElementDocument* Context::GetDocument(const String& id)
 {
 {
-	const String lower_id = id;
-
 	for (int i = 0; i < root->GetNumChildren(); i++)
 	for (int i = 0; i < root->GetNumChildren(); i++)
 	{
 	{
 		ElementDocument* document = root->GetChild(i)->GetOwnerDocument();
 		ElementDocument* document = root->GetChild(i)->GetOwnerDocument();
 		if (document == NULL)
 		if (document == NULL)
 			continue;
 			continue;
 
 
-		if (document->GetId() == lower_id)
+		if (document->GetId() == id)
 			return document;
 			return document;
 	}
 	}
 
 

+ 1 - 4
Source/Core/ElementUtilities.cpp

@@ -47,15 +47,12 @@ Element* ElementUtilities::GetElementById(Element* root_element, const String& i
 	SearchQueue search_queue;
 	SearchQueue search_queue;
 	search_queue.push(root_element);
 	search_queue.push(root_element);
 
 
-	// Lowercase the id for searching
-	String lower_id = id;
-	
 	while (!search_queue.empty())
 	while (!search_queue.empty())
 	{
 	{
 		Element* element = search_queue.front();
 		Element* element = search_queue.front();
 		search_queue.pop();
 		search_queue.pop();
 		
 		
-		if (element->GetId() == lower_id)
+		if (element->GetId() == id)
 		{
 		{
 			return element;
 			return element;
 		}
 		}