Fixed a priority issue in tdict
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 3 Apr 2008 08:35:21 +0000 (08:35 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 3 Apr 2008 08:35:21 +0000 (08:35 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1119 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Common/Misc.py

index 4229d8a..b91c15f 100755 (executable)
@@ -565,9 +565,12 @@ class tdict:
         #print "%s-%s" % (FirstKey, self._Level_) ,\r
         if self._Level_ > 1:\r
             if FirstKey == self._Wildcard:\r
-                for Key in self.data:\r
-                    Value = self.data[Key][RestKeys]\r
-                    if Value != None: break\r
+                if FirstKey in self.data:\r
+                    Value = self.data[FirstKey][RestKeys]\r
+                if Value == None:\r
+                    for Key in self.data:\r
+                        Value = self.data[Key][RestKeys]\r
+                        if Value != None: break\r
             else:\r
                 if FirstKey in self.data:\r
                     Value = self.data[FirstKey][RestKeys]\r
@@ -575,11 +578,13 @@ class tdict:
                     #print "Value=None"\r
                     Value = self.data[self._Wildcard][RestKeys]\r
         else:\r
-            # "$"\r
             if FirstKey == self._Wildcard:\r
-                for Key in self.data:\r
-                    Value = self.data[Key]\r
-                    if Value != None: break\r
+                if FirstKey in self.data:\r
+                    Value = self.data[FirstKey]\r
+                if Value == None:\r
+                    for Key in self.data:\r
+                        Value = self.data[Key]\r
+                        if Value != None: break\r
             else:\r
                 if FirstKey in self.data:\r
                     Value = self.data[FirstKey]\r