This function should look something like this:

Change the rest of this to something like this:

    Expression indexExpr = children.get(1);
    if (!expression.evaluate(tuple, ptr)) {
      return false;
    } else if (ptr.getLength() == 0) {
      return true;
    }

    // Use Codec to prevent Integer object allocation
    int index = PDataType.INTEGER.getCodec().decodeInt(ptr);

    Expression arrayExpr = children.get(0);
    if (!expression.evaluate(tuple, ptr)) {
      return false;
    } else if (ptr.getLength() == 0) {
      return true;
    }

    // Given a ptr to the entire array, set ptr to point to a particular element within that array
    // given the type of an array element.
    ArrayUtil.getValue(ptr, index, getDataType());
    return true;