function tf = hasConsecutiveDuplicates(sp)
%MATLAB Code Generation Private Function
%
%    Simple check to determine if sp(:) is strictly increasing.
%
%   Copyright 2020 The MathWorks, Inc.
%#codegen
coder.internal.prefer_const(sp);
if coder.internal.isConst(sp)
    DIFF = coder.const(feval('diff',sp));
    DIFF_EQUALS_0 = coder.const(feval('eq',DIFF,0));
    tf = coder.const(feval('any',DIFF_EQUALS_0));
else
    tf = false;
    for ii = 2:numel(sp)
        tf = tf | (sp(ii) == sp(ii-1));
    end
end
end