public PartitionRecord getPartition(AllocateAction allocation) { PartitionRecord recordToReturn = null ; foreach (PartitionRecord record in simulatorModel.Partitions) { if (record.PartitionType == PartitionType.Free) { if (record.Size >= allocation.RequiredSize) { if (recordToReturn != null) { if (recordToReturn.Size > record.Size) { recordToReturn = record; } } else { recordToReturn = record; } } } } return recordToReturn; }
public PartitionRecord getPartition(AllocateAction allocation) { foreach (PartitionRecord record in simulatorModel.Partitions) { if (record.PartitionType == PartitionType.Free) { if (record.Size >= allocation.RequiredSize) { return record; } } } return null; }