mirror of git://gcc.gnu.org/git/gcc.git
2012-02-06 François Dumont <fdumont@gcc.gnu.org>
* include/debug/safe_iterator.h (_Safe_iterator::_M_before_dereferenceable): Avoid the expensive creation of a _Safe_iterator instance to do the check. From-SVN: r183941
This commit is contained in:
parent
cb406914ff
commit
74345dec22
|
|
@ -1,3 +1,9 @@
|
|||
2012-02-06 François Dumont <fdumont@gcc.gnu.org>
|
||||
|
||||
* include/debug/safe_iterator.h
|
||||
(_Safe_iterator::_M_before_dereferenceable): Avoid the expensive
|
||||
creation of a _Safe_iterator instance to do the check.
|
||||
|
||||
2012-02-05 Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||
|
||||
PR libstdc++/52104
|
||||
|
|
|
|||
|
|
@ -380,8 +380,12 @@ namespace __gnu_debug
|
|||
bool
|
||||
_M_before_dereferenceable() const
|
||||
{
|
||||
_Self __it = *this;
|
||||
return __it._M_incrementable() && (++__it)._M_dereferenceable();
|
||||
if (this->_M_incrementable())
|
||||
{
|
||||
_Iterator __base = base();
|
||||
return ++__base != _M_get_sequence()->_M_base().end();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// Is the iterator incrementable?
|
||||
|
|
|
|||
Loading…
Reference in New Issue