This can also be done without a table by using select or a recursive function.
As for efficiency, I can't say whether the overhead of the function calls would outweigh dealing with recycling a table. It's probably simpler to write, at any rate.
Lua Code:
local function ProcessFrames(...)
local n = select('#', ...)
for i = 1, n do select(i, ...):UnregisterEvent('ZONE_CHANGED_NEW_AREA') end
-- Do stuff
for i = 1, n do select(i, ...):RegisterEvent('ZONE_CHANGED_NEW_AREA') end
end
ProcessFrames(GetFramesRegisteredForEvent('ZONE_CHANGED_NEW_AREA'))
More importantly, I'm unsure if there's potential for a race condition by doing this.
What happens if the event fires while you're unregistering frames?