diff options
author | Carsey, Jaben <jaben.carsey@intel.com> | 2018-04-20 23:51:44 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2018-04-26 14:44:35 +0800 |
commit | 6553c61724f74bd160d2002f5aa768aa687a2af4 (patch) | |
tree | c5dc5926ad318c28ef513d21362bacd4619dbc8c /BaseTools/Source/Python/GenFds | |
parent | 992fbe3519c0a0b643b93ecbf9bd6297c9117714 (diff) | |
download | edk2-6553c61724f74bd160d2002f5aa768aa687a2af4.tar.gz edk2-6553c61724f74bd160d2002f5aa768aa687a2af4.tar.bz2 edk2-6553c61724f74bd160d2002f5aa768aa687a2af4.zip |
BaseTools: GenFds - simplify testing for Hex number
Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@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 | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/BaseTools/Source/Python/GenFds/FdfParser.py b/BaseTools/Source/Python/GenFds/FdfParser.py index 6baf875833..25755a9778 100644 --- a/BaseTools/Source/Python/GenFds/FdfParser.py +++ b/BaseTools/Source/Python/GenFds/FdfParser.py @@ -1183,13 +1183,6 @@ class FdfParser: self.__GetOneChar()
- def __IsHex(self, HexStr):
- if not HexStr.upper().startswith("0X"):
- return False
- if len(self.__Token) <= 2:
- return False
- return True if all(x in string.hexdigits for x in HexStr[2:]) else False
-
## __GetNextHexNumber() method
#
# Get next HEX data before a seperator
@@ -1202,7 +1195,7 @@ class FdfParser: def __GetNextHexNumber(self):
if not self.__GetNextToken():
return False
- if self.__IsHex(self.__Token):
+ if gHexPatternAll.match(self.__Token):
return True
else:
self.__UndoToken()
|