Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ArrayCleanup(a) {
- foreach (i, v in a) {
- switch (typeof(v)) {
- case "null":
- case "integer":
- case "float":
- case "string":
- case "function": break;
- case "class": TableCleanup(v); break;
- case "table": TableCleanup(v); break;
- case "array": ArrayCleanup(v); break;
- default: t.rawset(k, null); break;
- }
- }
- }
- function TableCleanup(t) {
- foreach (k, v in t) {
- switch (typeof(v)) {
- case "null":
- case "integer":
- case "float":
- case "string":
- case "function": break;
- case "class": TableCleanup(v); break;
- case "table": TableCleanup(v); break;
- case "array": ArrayCleanup(v); break;
- default: t.rawset(k, null); break;
- }
- }
- }
- // Start with the root table
- TableCleanup(getroottable());
- // Who knows :/
- collectgarbage();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement