Mercurial > jwe > octave
diff libinterp/octave-value/ov-class.cc @ 30144:c789e728d57a
Backed out changeset 938794bc82b7
Renaming octave_base_value::count to m_count breaks some packages that
define new octave_value data types. Maybe those packages shouldn't be
touching the count directly, but they do. Since we may also want to
switch to using std::shared_ptr to manage octave_value objects instead
of our own custom reference counting implmentation, it is probably
best to delay this change until we know exactly what path we want to
take.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 08 Sep 2021 11:14:44 -0400 |
parents | 938794bc82b7 |
children | 91c6288781ba |
line wrap: on
line diff
--- a/libinterp/octave-value/ov-class.cc Wed Sep 08 06:46:19 2021 -0400 +++ b/libinterp/octave-value/ov-class.cc Wed Sep 08 11:14:44 2021 -0400 @@ -208,16 +208,16 @@ octave_base_value * octave_class::unique_clone (void) { - if (m_count == m_obsolete_copies) + if (count == m_obsolete_copies) { // All remaining copies are obsolete. We don't actually need to clone. - m_count++; + count++; return this; } else { // In theory, this shouldn't be happening, but it's here just in case. - if (m_count < m_obsolete_copies) + if (count < m_obsolete_copies) m_obsolete_copies = 0; return clone (); @@ -320,7 +320,7 @@ if (meth.is_defined ()) { - m_count++; + count++; octave_value_list args (1, octave_value (this)); octave_value_list lv = octave::feval (meth.function_value (), args, 1); @@ -363,7 +363,7 @@ { octave_value_list args (idx.length () + 1, octave_value ()); - m_count++; + count++; args(0) = octave_value (this); for (octave_idx_type i = 0; i < idx.length (); i++) @@ -461,7 +461,7 @@ args(1) = make_idx_args (type, idx, "subsref"); - m_count++; + count++; args(0) = octave_value (this); // FIXME: for Matlab compatibility, let us attempt to set up a proper @@ -525,7 +525,7 @@ const std::list<octave_value_list>& idx, const octave_value& rhs) { - m_count++; + count++; return subsasgn_common (octave_value (this), type, idx, rhs); } @@ -627,7 +627,7 @@ obvp->subsasgn (type, idx, rhs); - m_count++; + count++; retval = octave_value (this); return retval; @@ -753,7 +753,7 @@ m_map.assign (idx.front (), key, t_rhs); - m_count++; + count++; retval = octave_value (this); } else @@ -764,7 +764,7 @@ m_map.assign (idx.front (), rhs_map); - m_count++; + count++; retval = octave_value (this); } else @@ -774,7 +774,7 @@ m_map.delete_elements (idx.front ()); - m_count++; + count++; retval = octave_value (this); } } @@ -809,7 +809,7 @@ m_map.setfield (key, tmp_cell); } - m_count++; + count++; retval = octave_value (this); } break;