@staticmethod
def _instance_in_array(object_instance, object_array):
    """Check if a specific object instance is already in an array.

        This can be much faster than  `if object_instance in object_array`
        when you expect to be testing a lot of the same instance of an object for
        inclusion in an array since the builtin method uses an == operator to
        test inclusion.
        """
    for val in object_array:
        if val is object_instance:
            return True
    return False
