check method

bool check(
  1. T value,
  2. bool asc
)

Implementation

bool check(T value, bool asc) => asc
    ? equal
        ? element >= value
        : element > value
    : equal
        ? element <= value
        : element < value;