function this = pruneGridIndices(this)
% After the optimization is done, if we're doing gridsearch, remove the
% last sampled point because it has not been evaluated. This is to set us
% up for resuming.

%   Copyright 2016-2023 The MathWorks, Inc.

if doingGridsearch(this) && ~isempty(this.XNext)
    this.SampledGridIndices(end, :) = [];
end
end
