Refactor to invoke only one GetBestLanguage()
authorqhuang8 <qhuang8@65ba2f78-6c18-0410-a7b4-885970cf29fa>
Wed, 25 Mar 2009 08:40:00 +0000 (08:40 +0000)
committerqhuang8 <qhuang8@65ba2f78-6c18-0410-a7b4-885970cf29fa>
Wed, 25 Mar 2009 08:40:00 +0000 (08:40 +0000)
git-svn-id: https://fat-driver2.tianocore.org/svn/fat-driver2/trunk@38 65ba2f78-6c18-0410-a7b4-885970cf29fa

FatPkg/EnhancedFatDxe/UnicodeCollation.c

index 574db97..e0b7e0d 100644 (file)
@@ -87,23 +87,13 @@ InitializeUnicodeCollationSupportWorker (
     // Find the best matching matching language from the supported languages\r
     // of Unicode Collation (2) protocol. \r
     //\r
-    if (Language == NULL) {\r
-      BestLanguage = GetBestLanguage (\r
-                       Uci->SupportedLanguages,\r
-                       Iso639Language,\r
-                       DefaultLanguage,\r
-                       NULL\r
-                       );\r
-    } else {\r
-      BestLanguage = GetBestLanguage (\r
-                       Uci->SupportedLanguages,\r
-                       Iso639Language,\r
-                       Language,\r
-                       Iso639Language,\r
-                       DefaultLanguage,\r
-                       NULL\r
-                       );\r
-    }\r
+    BestLanguage = GetBestLanguage (\r
+                     Uci->SupportedLanguages,\r
+                     Iso639Language,\r
+                     (Language == NULL) ? Language : "",\r
+                     DefaultLanguage,\r
+                     NULL\r
+                     );\r
     if (BestLanguage != NULL) {\r
       FreePool (BestLanguage);\r
       mUnicodeCollationInterface = Uci;\r