diff --git a/changes.txt b/changes.txt index e330b909..452ef8fb 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,6 @@ -------------------------- Changes in 1.9 (not yet released) +- Speedup: Avoid string copy in CXMLReaderImpl::getAttributeByName - Fix bug in rect::clipAgainst that had caused rects completely outside to the left-top of the rect to be clipped against ending up with both corners outside. It still worked for UI in most cases as the resulting rectangle still had an area of 0. - Add getAlign functions to IGUIElement diff --git a/source/Irrlicht/CXMLReaderImpl.h b/source/Irrlicht/CXMLReaderImpl.h index 6f1192c6..6dbf5297 100644 --- a/source/Irrlicht/CXMLReaderImpl.h +++ b/source/Irrlicht/CXMLReaderImpl.h @@ -494,14 +494,12 @@ private: // finds a current attribute by name, returns 0 if not found const SAttribute* getAttributeByName(const char_type* name) const { - if (!name) - return 0; - - core::string n = name; - - for (int i=0; i<(int)Attributes.size(); ++i) - if (Attributes[i].Name == n) - return &Attributes[i]; + if (name) + { + for (irr::u32 i=0; i diff --git a/tests/tests-last-passed-at.txt b/tests/tests-last-passed-at.txt index 09ce1bdc..ce36a6bf 100644 --- a/tests/tests-last-passed-at.txt +++ b/tests/tests-last-passed-at.txt @@ -1,4 +1,4 @@ Tests finished. 72 tests of 72 passed. Compiled as DEBUG -Test suite pass at GMT Thu Feb 11 14:00:00 2021 +Test suite pass at GMT Sat Feb 13 16:24:31 2021