Use shared_ptr::unique() instead of shared_ptr::use_count() == 1.
authorDavid Robillard <d@drobilla.net>
Sun, 1 Nov 2009 17:25:38 +0000 (17:25 +0000)
committerDavid Robillard <d@drobilla.net>
Sun, 1 Nov 2009 17:25:38 +0000 (17:25 +0000)
commitb63a9fd4ca4814a3eb642b6dceef0e507e1cdee3
treeec55cf1d629141f4388451fc8c194e494bff4fe9
parent6bb54878523e4a9cbf9aa886758fa584d1a9bd0a
Use shared_ptr::unique() instead of shared_ptr::use_count() == 1.

use_count() can be slow (not constant time) depending on underlying implementation.
Similar situation to std::list::size() == 0 an std::list::empty(), the former
does a big traversal/computation only to check if the very first step went.
I think the current boost implementation is just a reference count anyway, but
hey.  In theory.

git-svn-id: svn://localhost/ardour2/branches/3.0@5996 d708f5d6-7413-0410-9779-e7cbd77b26cf
libs/pbd/pbd/rcu.h