/* If an entry with  is already available in the table, return its index without adding a new entry. */
STATIC UINT32 EFIAPI MappingTableAdd(IN MAPPING_TABLE *MappingTable, IN UINT32 Integer)
/* If an entry with  is already available in the table, return its index without adding a new entry. */
STATIC UINT32 EFIAPI MappingTableAdd(IN MAPPING_TABLE *MappingTable, IN UINT32 Integer)
{
  UINT32  *Table;
  UINT32  Index;
  UINT32  LastIndex;
  ASSERT (MappingTable != NULL);
  ASSERT (MappingTable->Table != NULL);
  Table     = MappingTable->Table;
  LastIndex = MappingTable->LastIndex;
  for (Index = 0; Index < LastIndex; Index++) {
    if (Table[Index] == Integer) {
      return Index;
    }
  }
  ASSERT (LastIndex < MappingTable->MaxIndex);
  Table[LastIndex] = Integer;
  return MappingTable->LastIndex++;
}