HH\Lib\Keyset\equal

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

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

Returns whether the two given keysets have the same elements, using strict equality

namespace HH\Lib\Keyset;

function equal<Tv as arraykey>(
  keyset<Tv> $keyset1,
  keyset<Tv> $keyset2,
): bool;

To guarantee equality of order as well as contents, use ===.

Time complexity: O(n) Space complexity: O(1)

Parameters

  • keyset<Tv> $keyset1
  • keyset<Tv> $keyset2

Returns

  • bool