summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQing Huang <qing.huang@intel.com>2009-03-25 08:40:00 +0000
committerJordan Justen <jordan.l.justen@intel.com>2016-04-06 23:22:43 -0700
commit2cd1716d61522d2750b3d2748e0319644d0eac08 (patch)
tree03ba2354ef4682fd290f50f43bcf9d58877b159f
parentb2477ca46c8b6a8b65ffe076f68db5daafec7d32 (diff)
downloadedk2-platforms-2cd1716d61522d2750b3d2748e0319644d0eac08.tar.xz
Refactor to invoke only one GetBestLanguage()
(based on FatPkg commit 25e83a4e8906ef80e428b7c446216faa1ba9e2a7) [jordan.l.justen@intel.com: Use script to relicense to 2-clause BSD] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Acked-by: Mark Doran <mark.doran@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com>
-rw-r--r--FatPkg/EnhancedFatDxe/UnicodeCollation.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/FatPkg/EnhancedFatDxe/UnicodeCollation.c b/FatPkg/EnhancedFatDxe/UnicodeCollation.c
index 574db9783e..e0b7e0d6f0 100644
--- a/FatPkg/EnhancedFatDxe/UnicodeCollation.c
+++ b/FatPkg/EnhancedFatDxe/UnicodeCollation.c
@@ -87,23 +87,13 @@ InitializeUnicodeCollationSupportWorker (
// Find the best matching matching language from the supported languages
// of Unicode Collation (2) protocol.
//
- if (Language == NULL) {
- BestLanguage = GetBestLanguage (
- Uci->SupportedLanguages,
- Iso639Language,
- DefaultLanguage,
- NULL
- );
- } else {
- BestLanguage = GetBestLanguage (
- Uci->SupportedLanguages,
- Iso639Language,
- Language,
- Iso639Language,
- DefaultLanguage,
- NULL
- );
- }
+ BestLanguage = GetBestLanguage (
+ Uci->SupportedLanguages,
+ Iso639Language,
+ (Language == NULL) ? Language : "",
+ DefaultLanguage,
+ NULL
+ );
if (BestLanguage != NULL) {
FreePool (BestLanguage);
mUnicodeCollationInterface = Uci;