pike.git / lib / modules / Array.pmod

version» Context lines:

pike.git/lib/modules/Array.pmod:526:    string a0=a,b0=b;    a=replace(lower_case(a),"][\\}{|"/1,"åäöåäö"/1);    b=replace(lower_case(b),"][\\}{|"/1,"åäöåäö"/1);       while (sscanf(a0=a,"%*[ \t](%*[^)])%*[ \t]%s",a)==4 && a0!=a);    while (sscanf(b0=b,"%*[ \t](%*[^)])%*[ \t]%s",b)==4 && b0!=b);    a0=b0="";    sscanf(a,"%[^ \t]%*[ \t](%*[^)])%*[ \t]%s",a,a0);    sscanf(b,"%[^ \t]%*[ \t](%*[^)])%*[ \t]%s",b,b0);    if (a>b) return 1; -  if (a<b) return 0; +  if (a<b) return -1;    if (a0==b0) return 0;    return lyskom_sort_func(a0,b0);   }      //! Flatten a multi-dimensional array to a one-dimensional array.   array flatten(array a)   {    array ret=({});    foreach(a, mixed b) ret+=arrayp(b)?flatten([array]b):({b});    return ret;