BUG-582: optimize InstanceIdentifier.firstIdentifierOf()
Performance tracing of OpenFlow components found that we are spending
cycles copying arguments in create() when called from firstIdentifierOf().
This does not make sense, as we know the argument list is immutable in
this code path.
As it turns out, the copy guard in create() is not sufficient to prevent
the copy, as the Iterables.limit() instantiates a FluentIterable, not an
ImmutableCollection.
This patch elides the copy by splitting the non-copy part of logic of
create() to a private method, internalCreate(). firstIdentifierOf()
calls this method directly, while create() calls it after potentially
creating a copy.
Change-Id: I5c3dbb5c6b5e26d30a0bb407822f1d40fcc898f5
Signed-off-by: Robert Varga <rovarga@cisco.com>