Method code for $list.set_equal()

[Turn on line numbering]
arg set1, set2;
var e, dict1, dict2;

// True if the two lists given contain the same elements.
// False otherwise.
dict1 = hash e in (set1) to ([e, 1]);
dict2 = hash e in (set2) to ([e, 1]);
for e in (dict1.keys()) {
    if (!dict_contains(dict2, e))
        return 0;
}
for e in (dict2.keys()) {
    if (!dict_contains(dict1, e))
        return 0;
}
return 1;

["// Created 26-Mar-1995 as a part of ColdCore, see: @help Credit"]

the Cold Dark