distinct_array.c

foundation2_fluffos_v1/lib/secure/sefun/distinct_array.c · 357 B

From the archive foundation2_fluffos_v1.zip

Download the archive   « Back to the archive contents

//    /adm/simul_efun/distinct_array.c
//    from Foundation II
//    a faster, better namedfunction based on Huthar's uniq_array()
//    by Descartes of Borg 940117

mixed *distinct_array(mixed *arr) {
    mapping tmp;
    int i, maxi;

    for(i = 0, tmp = allocate_mapping(maxi = sizeof(arr)); i<maxi; i++)
      tmp[arr[i]] = 1;
    return keys(tmp);
}

Site Stats

Snippets: 1791
Codebases: 571