[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #62802] "methods classdef" shows some methods

From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #62802] "methods classdef" shows some methods twice
Date: Sat, 30 Jul 2022 09:06:15 -0400 (EDT)

Follow-up Comment #2, bug #62802 (project octave):

If I understand the implementation correctly, the string_vector must be sorted
(or the duplicate items must be next to each other) for
`string_vector::uniq()` to actually remove all duplicate strings.

string_vector::uniq (void)
  octave_idx_type len = numel ();

  if (len > 0)
      octave_idx_type k = 0;

      for (octave_idx_type i = 1; i < len; i++)
        if (elem (i) != elem (k))
          if (++k != i)
            elem (k) = elem (i);

      if (len != ++k)
        resize (k);

  return *this;


Reply to this item at:


Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]