From bfc8f5667a68071e7f12a9ba2a0cf076b1285107 Mon Sep 17 00:00:00 2001 From: "Carsey, Jaben" Date: Wed, 4 Apr 2018 06:34:06 +0800 Subject: BaseTools: remove redundant check The RegEx matches begining and end of the string, dont then check length. Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jaben Carsey Reviewed-by: Yonghong Zhu --- BaseTools/Source/Python/AutoGen/UniClassObject.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BaseTools/Source/Python/AutoGen/UniClassObject.py') diff --git a/BaseTools/Source/Python/AutoGen/UniClassObject.py b/BaseTools/Source/Python/AutoGen/UniClassObject.py index 8b0c563a8c..5b879d784d 100644 --- a/BaseTools/Source/Python/AutoGen/UniClassObject.py +++ b/BaseTools/Source/Python/AutoGen/UniClassObject.py @@ -352,7 +352,7 @@ class UniFileClassObject(object): # Check the string name if Name != '': MatchString = gIdentifierPattern.match(Name) - if MatchString is None or MatchString.end(0) != len(Name): + if MatchString is None: EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid character.' % (Name, self.File)) LanguageList = Item.split(u'#language ') for IndexI in range(len(LanguageList)): @@ -522,7 +522,7 @@ class UniFileClassObject(object): # Check the string name if not self.IsCompatibleMode and Name != '': MatchString = gIdentifierPattern.match(Name) - if MatchString is None or MatchString.end(0) != len(Name): + if MatchString is None: EdkLogger.error('Unicode File Parser', FORMAT_INVALID, 'The string token name %s defined in UNI file %s contains the invalid character.' % (Name, self.File)) self.AddStringToList(Name, Language, Value) continue -- cgit v1.2.3