lessThanOrEquals method

bool lessThanOrEquals(
  1. InkList otherList
)
Returns true if the item values in the current list overlap or are all less than the item values in the passed in list. None of the item values in the current list must go above the item values in the passed in list. Equivalent to (list1 <= list2) in ink, or LIST_MAX(list1) <= LIST_MAX(list2) && LIST_MIN(list1) <= LIST_MIN(list2).

Implementation

bool lessThanOrEquals(InkList otherList) {
  if (otherList.isEmpty) return false;
  if (isEmpty) return true;

  return maxItem.value <= otherList.maxItem.value &&
      minItem.value <= otherList.minItem.value;
}