projects
/
libcds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
df51f37
)
improved clear()
author
khizmax
<khizmax@gmail.com>
Fri, 29 Jul 2016 15:53:09 +0000
(18:53 +0300)
committer
khizmax
<khizmax@gmail.com>
Fri, 29 Jul 2016 15:53:09 +0000
(18:53 +0300)
cds/intrusive/mspriority_queue.h
patch
|
blob
|
history
diff --git
a/cds/intrusive/mspriority_queue.h
b/cds/intrusive/mspriority_queue.h
index ba3db521c1215e9c124ce53b75347d39b84375ec..5d3d0805816cf366660e87f72e379ef145900987 100644
(file)
--- a/
cds/intrusive/mspriority_queue.h
+++ b/
cds/intrusive/mspriority_queue.h
@@
-386,11
+386,9
@@
namespace cds { namespace intrusive {
template <typename Func>
void clear_with( Func f )
{
- while ( !empty() ) {
- value_type * pVal = pop();
- if ( pVal )
- f( *pVal );
- }
+ value_type * pVal;
+ while (( pVal = pop()) != nullptr )
+ f( *pVal );
}
/// Checks is the priority queue is empty