private void adjustArray(int size) {
        if (size < MIN_SIZE) {
            size = MIN_SIZE;
        }
        double[] newdoubles = new double[size];
        int len = Math.min(size,doubles.length);
        System.arraycopy(doubles,0,newdoubles,0,len);
        doubles = newdoubles;
    }
Adjusts the size of the array.
@param size The new capacity of the array.
Ghidra/Framework/Generic/src/main/java/ghidra/util/datastruct/DoubleArray.java