Small optimization.

[SVN r16790]
This commit is contained in:
Peter Dimov
2003-01-07 23:12:02 +00:00
parent e3f2329c14
commit 1dee6e0229

View File

@ -159,7 +159,7 @@ static void scan_and_count(void const * area, size_t size, map_type const & m, s
{ {
shared_ptr_layout const * q = reinterpret_cast<shared_ptr_layout const *>(p); shared_ptr_layout const * q = reinterpret_cast<shared_ptr_layout const *>(p);
if(q->pn.id == boost::detail::shared_count_id && m.count(q->pn.pi) != 0) if(q->pn.id == boost::detail::shared_count_id && q->pn.pi != 0 && m.count(q->pn.pi) != 0)
{ {
++m2[q->pn.pi]; ++m2[q->pn.pi];
} }
@ -175,7 +175,7 @@ static bool scan_and_mark(void const * area, size_t size, map_type const & m, st
{ {
shared_ptr_layout const * q = reinterpret_cast<shared_ptr_layout const *>(p); shared_ptr_layout const * q = reinterpret_cast<shared_ptr_layout const *>(p);
if(q->pn.id == boost::detail::shared_count_id && m.count(q->pn.pi) != 0) if(q->pn.id == boost::detail::shared_count_id && q->pn.pi != 0 && m.count(q->pn.pi) != 0)
{ {
// mark as reachable // mark as reachable