Code: Select all
RmvDuplic(object) {
secondobject:=[]
Loop % object.Length()
{
value:=Object.RemoveAt(1) ; otherwise Object.Pop() a little faster, but would not keep the original order
Loop % secondobject.Length()
If (value=secondobject[A_Index])
Continue 2 ; jump to the top of the outer loop, we found a duplicate, discard it and move on
secondobject.Push(value)
}
Return secondobject
}
Code: Select all
RmvDuplic2(object) {
secondobject:=[]
Loop object.Length()
{
value:=Object.RemoveAt(1)
Loop secondobject.Length()
If (value=secondobject[A_Index])
Continue 2 ; jump to the top of the outer loop, we found a duplicate, discard it and move on
secondobject.Push(value)
}
Return secondobject
}