소스 검색

Merge pull request #205 from Dmitry-Me/moveDefinitionsToLoopHeaders

Move loop variable definition into loop headers
Lee Thomason 11 년 전
부모
커밋
fb732f97d4
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      tinyxml2.cpp

+ 2 - 4
tinyxml2.cpp

@@ -1218,8 +1218,7 @@ XMLElement::~XMLElement()
 
 XMLAttribute* XMLElement::FindAttribute( const char* name )
 {
-    XMLAttribute* a = 0;
-    for( a=_rootAttribute; a; a = a->_next ) {
+    for( XMLAttribute* a = _rootAttribute; a; a = a->_next ) {
         if ( XMLUtil::StringEqual( a->Name(), name ) ) {
             return a;
         }
@@ -1230,8 +1229,7 @@ XMLAttribute* XMLElement::FindAttribute( const char* name )
 
 const XMLAttribute* XMLElement::FindAttribute( const char* name ) const
 {
-    XMLAttribute* a = 0;
-    for( a=_rootAttribute; a; a = a->_next ) {
+    for( XMLAttribute* a = _rootAttribute; a; a = a->_next ) {
         if ( XMLUtil::StringEqual( a->Name(), name ) ) {
             return a;
         }