query/src/main/java/jetbrains/exodus/query/InMemoryQuickSortOnInitIterable.java [26:79]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        super(source, comparator);
    }

    @Override
    public @NotNull Iterator<Entity> iterator() {
        return new Iterator<Entity>() {
            private List<Entity> src;
            private Entity[] tmp;
            private int current;

            @Override
            public boolean hasNext() {
                if (src == null) {
                    init();
                }
                return current < src.size();
            }

            @Override
            public Entity next() {
                if (src == null) {
                    init();
                }
                if (current >= src.size()) {
                    throw new NoSuchElementException();
                }
                return src.get(current++);
            }

            @Override
            public void remove() {
                throw new UnsupportedOperationException();
            }

            public void init() {
                src = new ArrayList<>();
                for (final Entity entity : getSrc()) {
                    src.add(entity);
                }
                tmp = new Entity[src.size()];
                qsort(0, tmp.length - 1);
            }

            /**
             * sort src[left..right]
             * @param left left
             * @param right right
             */
            public void qsort(int left, int right) {
                if (left >= right) {
                    return;
                }
                Entity median = src.get((left + right) / 2);
                int i = left;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



query/src/main/java/jetbrains/exodus/query/InMemoryQuickSortTwoSidesIterable.java [26:79]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        super(source, comparator);
    }

    @Override
    public @NotNull Iterator<Entity> iterator() {
        return new Iterator<Entity>() {
            private List<Entity> src;
            private Entity[] tmp;
            private int current;

            @Override
            public boolean hasNext() {
                if (src == null) {
                    init();
                }
                return current < src.size();
            }

            @Override
            public Entity next() {
                if (src == null) {
                    init();
                }
                if (current >= src.size()) {
                    throw new NoSuchElementException();
                }
                return src.get(current++);
            }

            @Override
            public void remove() {
                throw new UnsupportedOperationException();
            }

            public void init() {
                src = new ArrayList<>();
                for (final Entity entity : getSrc()) {
                    src.add(entity);
                }
                tmp = new Entity[src.size()];
                qsort(0, tmp.length - 1);
            }

            /**
             * sort src[left..right]
             * @param left left
             * @param right right
             */
            public void qsort(int left, int right) {
                if (left >= right) {
                    return;
                }
                Entity median = src.get((left + right) / 2);
                int i = left;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



