mirror of https://github.com/acidanthera/audk.git
MdePkg/BaseUefiDecompressLib: Improve performance of boundary validation
The boundary validation checking in MakeTable() performs on every loop iteration. This could be improved by checking just once before the loop. https://bugzilla.tianocore.org/show_bug.cgi?id=1329 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
This commit is contained in:
parent
55756c88ae
commit
8028f03032
|
@ -222,10 +222,11 @@ MakeTable (
|
|||
|
||||
if (Len <= TableBits) {
|
||||
|
||||
if (Start[Len] >= NextCode || NextCode > MaxTableLength){
|
||||
return (UINT16) BAD_TABLE;
|
||||
}
|
||||
|
||||
for (Index = Start[Len]; Index < NextCode; Index++) {
|
||||
if (Index >= MaxTableLength) {
|
||||
return (UINT16) BAD_TABLE;
|
||||
}
|
||||
Table[Index] = Char;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue