List<CharSequence> (int start, int end, @NotNull CharSequence text, @NotNull LineOffsets lineOffsets, @NotNull BitSet ignored) { StringBuilder sb = new StringBuilder(); List<CharSequence> lines = new ArrayList<>(end - start); for (int line = start; line < end; line++) { for (int offset = lineOffsets.getLineStart(line); offset < lineOffsets.getLineEnd(line); offset++) { if (ignored.get(offset)) continue; sb.append(text.charAt(offset)); } lines.add(sb.toString()); sb.setLength(0); } return lines; }