expand_keys.c
ds2.9a10/lib/secure/sefun/expand_keys.c · 460 B
From the archive ds2.9a10.zip
Download the archive « Back to the archive contents
/* /secure/sefun/expand_keys.c
* from the Dead Souls Object Library
* takes a mapping with array keys and flattens the arrays
* created by Descartes of Borg 951013
*/
mapping expand_keys(mapping mp) {
mapping tmp = ([]);
mixed key, val;
foreach(key, val in mp) {
if( arrayp(key) ) {
string elem;
foreach(elem in key) tmp[elem] = val;
}
else tmp[key] = val;
}
return tmp;
}