Optimize AbstractTypeGenerator.listKeys()
In case of an empty key definition we end up allocating
short-lived empty ArrayLists, which is not efficient. Also lists
typically have a few elements, so we end up over-allocating them.
This fixes both cases, by checking the definition first and
returning an empty list in case the definition is empty, as well
as properly allocating efficient implementation where needed.
Change-Id: I99e8843abf6040654fab96052352cbfb29590ecf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit
efe9042ecb51521850d9b90f4d8460a35c9bd9ea)