Special case of the position creation, where there's no quantifier, so the index does not count.
320678
private static PortablePosition createPositionForReadAccess(
            PortableNavigatorContext ctx, PortablePathCursor path) throws IOException {
        int notArrayCellAccessIndex = -1;
        return createPositionForReadAccess(ctx, path, notArrayCellAccessIndex);
    }
1083269
private int countNonNewline(char[] cbuf, int off, int len) {
    for(int cnt = 0; cnt < len; cnt++) {
      final int pos = off + cnt;
      if(cbuf[pos] == UNIX_NEWLINE) {
        return cnt;
      }
      if(cbuf[pos] == CARRIAGE_RETURN) {
        return cnt;
      }
    }
    return len;
  }
1017784
def get_new_index(self):
        
        free_index = next(filterfalse(self.numbers.__contains__, count(0, 1)))
        self.numbers.add(free_index)
        return free_index
1135702
public int getDepth(int index) {
    if (index == 0) {
      return 0;
    } else {
      int[] parts = findSubexpression(index);
      return 1 + subexpressions.get(parts[0]).getDepth(parts[1]);
    }
  }
980940
private void prependValueLength(int value, int index) {
    int initialValue = toIntUnsigned(getValue(index));
    int length = toIntUnsigned(getLength(index));
    setValue(index, (short) value);
    setLength(index, (short) (initialValue - value + length));
  }
591762
private int countNonNewline(String str, int off, int len) {
    for(int cnt = 0; cnt < len; cnt++) {
      final int pos = off + cnt;
      if(str.charAt(pos) == UNIX_NEWLINE) {
        return cnt;
      }
      if(str.charAt(pos) == CARRIAGE_RETURN) {
        return cnt;
      }
    }
    return len;
  }
1274002
private int getNonNegativeInt(String s) {
        int i;

        try {
            i = Integer.parseInt(s);
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException("Unable to handle non-numeric value " + s);
        }

        if (i < 0) {
            throw new IllegalArgumentException(s + " is an invalid index value");
        }

        return i;
    }
349024
public void excludePositions(ArrayList<Integer> positions) {
    for (Integer p : positions) {
      if (realTSindex.containsKey(p)) {
        SAXRecord rec = realTSindex.get(p);
        rec.removeIndex(p);
        if (rec.getIndexes().isEmpty()) {
          this.records.remove(String.valueOf(rec.getPayload()));
        }
        realTSindex.remove(p);
      }
    }
  }
673161
private int skipPast(byte[] data, int pos, byte target) {
        int index = pos;
        while (index < data.length) {
            if (target == data[index++]) {
                return index;
            }
        }
        return index;
    }
236796
def collapse(self):
        

        if self.cardinality:
            r = None
            for si in self._si_set:
                r = r._union(si) if r is not None else si

            return r

        else:
            # This is an empty StridedInterval...
            return StridedInterval.empty(self._bits)
267515
public void setPosition(int newIndex) {
    if (index != newIndex) {
      if (index == -1 || index > newIndex) {
        pos = 0;
        index = 0;
      } else {
        index++;
        if (length != NULL_LENGTH) {
          pos += length;
        }
      }

      for (; index <= newIndex; index++) {
        if (index != newIndex) {
          int type = this.buf[this.pos++] & 0xff;
          switch (type) {
            case 251:
              break;
            case 252:
              pos += 2 + (0xffff & (((buf[pos] & 0xff) + ((buf[pos + 1] & 0xff) << 8))));
              break;
            case 253:
              pos += 3 + (0xffffff & ((buf[pos] & 0xff)
                  + ((buf[pos + 1] & 0xff) << 8)
                  + ((buf[pos + 2] & 0xff) << 16)));
              break;
            case 254:
              pos += 8 + ((buf[pos] & 0xff)
                  + ((long) (buf[pos + 1] & 0xff) << 8)
                  + ((long) (buf[pos + 2] & 0xff) << 16)
                  + ((long) (buf[pos + 3] & 0xff) << 24)
                  + ((long) (buf[pos + 4] & 0xff) << 32)
                  + ((long) (buf[pos + 5] & 0xff) << 40)
                  + ((long) (buf[pos + 6] & 0xff) << 48)
                  + ((long) (buf[pos + 7] & 0xff) << 56));
              break;
            default:
              pos += type;
              break;
          }
        } else {
          int type = this.buf[this.pos++] & 0xff;
          switch (type) {
            case 251:
              length = NULL_LENGTH;
              this.lastValueNull = BIT_LAST_FIELD_NULL;
              return;
            case 252:
              length = 0xffff & ((buf[pos++] & 0xff)
                  + ((buf[pos++] & 0xff) << 8));
              break;
            case 253:
              length = 0xffffff & ((buf[pos++] & 0xff)
                  + ((buf[pos++] & 0xff) << 8)
                  + ((buf[pos++] & 0xff) << 16));
              break;
            case 254:
              length = (int) ((buf[pos++] & 0xff)
                  + ((long) (buf[pos++] & 0xff) << 8)
                  + ((long) (buf[pos++] & 0xff) << 16)
                  + ((long) (buf[pos++] & 0xff) << 24)
                  + ((long) (buf[pos++] & 0xff) << 32)
                  + ((long) (buf[pos++] & 0xff) << 40)
                  + ((long) (buf[pos++] & 0xff) << 48)
                  + ((long) (buf[pos++] & 0xff) << 56));
              break;
            default:
              length = type;
              break;
          }
          this.lastValueNull = BIT_LAST_FIELD_NOT_NULL;
          return;
        }
      }
    }
    this.lastValueNull = length == NULL_LENGTH ? BIT_LAST_FIELD_NULL : BIT_LAST_FIELD_NOT_NULL;
  }
920031
public NegateMultiPos<S, Integer, Character> after(int leftIndex) {
		return new NegateMultiPos<S, Integer, Character>(leftIndex, null) {

			@Override protected S result() {
				return aQueue('K', left, right, pos, position, null, plusminus, filltgt);
			}
		};
	}
936031
private int indexForColumnName(String name) {
        final Integer index = rs.getColumnNames().get(name);
        if (index == null) { return -1; }
        return ((missingColumns & (1 << index.intValue())) == 0) ? index.intValue() : -1;
    }
968402
private /*@ helper @*/ void trimLeadingZeros() {
        int i = nWords;
        if (i > 0 && (data[--i] == 0)) {
            //for (; i > 0 && data[i - 1] == 0; i--) ;
            while(i > 0 && data[i - 1] == 0) {
                i--;
            }
            this.nWords = i;
            if (i == 0) { // all words are zero
                this.offset = 0;
            }
        }
    }
439409
public Compactor minorIndex(long index) {
    this.minorIndex = Math.max(this.minorIndex, index);
    Segment segment = segments.segment(minorIndex);
    if (segment != null) {
      compactIndex = segment.firstIndex();
    }
    return this;
  }
856622
def is_empty(self):
        '''
        
        '''
        return (self.is_valid() and
            not self.simple_lookups and
            not self.complex_conditions and
            not self.extra_conditions)
48319
public NegateMultiPos<S, Integer, Integer> setBetns(int leftIndex, int rightIndex) {
		return new NegateMultiPos<S, Integer, Integer>(leftIndex, rightIndex) {

			@Override protected S result() {
				return delegateQueue('I', left, right, pos, position, null, plusminus, filltgt);
			}
		};
	}