#include <Array.au3>
Local $rarray[36] = ['中文','中文','汉字','汉字','中文','string','string',5,5,6,7,5,'中文','中文','汉字','汉字','中文','string','string',5,5,6,7,5,'中文','中文','汉字','汉字','中文','string','string',5,5,6,7,5]
$t1 = TimerInit()
$a = del_chongfu($rarray)
$d1 = TimerDiff($t1)
_ArrayDisplay($a,"Time : " & Round($d1,1))
$t2 = TimerInit()
$b = Unique($rarray)
$d2 = TimerDiff($t2)
_ArrayDisplay($b,"Time : " & Round($d2,1))
Func Unique($Array)
If Not UBound($Array) Then Return ""
Local $Map[]
For $i In $Array
If Not MapExists($Map, $i) Then $Map[$i] = ""
Next
Local $MapKey = MapKeys($Map)
Local $Ret[UBound($MapKey)]
For $i = 0 To UBound($MapKey) -1
$Ret[$i] = $MapKey[$i]
Next
Return $Ret
EndFunc
Func del_chongfu($array)
Local $rarray[1] = [$array[0]],$temp
Assign($array[0], 0)
For $i = 1 To UBound($array)-1
$temp = $array[$i]
If Not IsDeclared($temp) Then
Assign($temp, $i)
ReDim $rarray[UBound($rarray)+1]
$rarray[UBound($rarray)-1] = $temp
EndIf
Next
Return $rarray
EndFunc