Fix memoization of functions called with keyset arguments
Summary:
Arguments to memoized functions get converted into memoization keys
using fb_compact_serialize. Due to a bug, keysets get treated like packed arrays
during compact serialization, which means that if the keyset has no integer
values, it gets treated like an empty array. Thus calling memoized functions
with different keysets would all return the same value. Fix this by properly
encoding keysets like mixed arrays (with a key and value). While we're there,
use the new Iterate interface instead of ArrayIter.
Reviewed By: markw65
Differential Revision:
D4307591
fbshipit-source-id:
e9c033eac231a840544eac8ded0c608a4a892710