diff options
author | Carsey, Jaben </o=Intel/ou=Americas01/cn=Workers/cn=Carsey, Jaben> | 2018-03-16 05:39:07 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-03-21 13:40:15 +0800 |
commit | 2eb370ffdb179a865a65a3bca40d284958e42424 (patch) | |
tree | cdfb4c9fe2a5c4305496d1b0df139416e59f5385 /BaseTools/Source/Python/GenFds | |
parent | 4d83616f9d7731934e7f91058efb165a2bc5b9d7 (diff) | |
download | edk2-2eb370ffdb179a865a65a3bca40d284958e42424.tar.gz edk2-2eb370ffdb179a865a65a3bca40d284958e42424.tar.bz2 edk2-2eb370ffdb179a865a65a3bca40d284958e42424.zip |
BaseTools: FdfParser & FdfParserLite refactor regular expression for GUIDs
Instead of recompiling it each time the API is called, just use
the global one that exists.
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/GenFds')
-rw-r--r-- | BaseTools/Source/Python/GenFds/FdfParser.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index dda7ed4ce7..19c1ad372c 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -59,6 +59,7 @@ import Common.LongFilePathOs as os from Common.LongFilePathSupport import OpenLongFilePath as open
from Capsule import EFI_CERT_TYPE_PKCS7_GUID
from Capsule import EFI_CERT_TYPE_RSA2048_SHA256_GUID
+from Common.RangeExpression import RangeExpression
##define T_CHAR_SPACE ' '
##define T_CHAR_NULL '\0'
@@ -1149,8 +1150,7 @@ class FdfParser: if not self.__GetNextToken():
return False
- p = re.compile('[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}')
- if p.match(self.__Token) != None:
+ if RangeExpression.RegGuidPattern.match(self.__Token) != None:
return True
else:
self.__UndoToken()
|