int index = -1;
float tmp = -1.0f;
for(int i = 0; i < ncount; i++)
{
= neighbour(geoself(), ptnum, i);
nbrnum if ( product_list[i] > tmp && not_element_of(visited, nbrnum))
{
= i;
index = product_list[i];
tmp }
};
return index;
int sorted_index[] = argsort(product_list);
for(int i = len(sorted_index)-1; i >= 0; i--)
{
= neighbour(geoself(), ptnum, pop(sorted_index));
nbrnum if (not_element_of(visited, nbrnum)){index = nbrnum; break;}
}
return index;
The latter is go, the former - no go. (The former is idiomatic to VOPs)