HH\Lib\Keyset\union

Requires the Hack Standard Library to be installed.
Facebook Engineer?

This function is available as Keyset\union() in Facebook's www repository.

Returns a new keyset containing all of the elements of the given Traversables

namespace HH\Lib\Keyset;

function union<Tv as arraykey>(
  Traversable<Tv> $first,
  Container<Tv> ...$rest,
): keyset<Tv>;

For a variable number of Traversables, see Keyset\flatten().

Time complexity: O(n + m), where n is the size of $first and m is the combined size of all the ...$rest Space complexity: O(n + m), where n is the size of $first and m is the combined size of all the ...$rest

Parameters

Returns

  • keyset<Tv>