if ( n1->m_nHash != n2->m_nHash )
return n1->m_nHash < n2->m_nHash ? -1 : 1;
- if ( n1->is_dummy() ) {
- assert( n2->is_dummy() );
+ if ( n1->is_dummy()) {
+ assert( n2->is_dummy());
return 0;
}
- assert( !n1->is_dummy() && !n2->is_dummy() );
+ assert( !n1->is_dummy() && !n2->is_dummy());
return native_key_comparator()( lhs, rhs );
}
if ( n1.m_nHash != n2.m_nHash )
return n1.m_nHash < n2.m_nHash ? -1 : 1;
- if ( n1.is_dummy() ) {
- assert( n2.is_dummy() );
+ if ( n1.is_dummy()) {
+ assert( n2.is_dummy());
return 0;
}
- assert( !n1.is_dummy() && !n2.is_dummy() );
+ assert( !n1.is_dummy() && !n2.is_dummy());
return base_class()( lhs, rhs );
}
while ( true ) {
node_type * pCur = pPrev->next.load( memory_model::memory_order_relaxed );
- if ( pCur == pCur->next.load( memory_model::memory_order_acquire ) ) {
+ if ( pCur == pCur->next.load( memory_model::memory_order_acquire )) {
// end-of-list
return pPrev;
}
void clear_stat()
{
- memset( this, 0, sizeof( *this ) );
+ memset( this, 0, sizeof( *this ));
}
};
struct cmp2 {
int operator ()( key_val const& lhs, key_val const& rhs ) const
{
- if ( lhs.key() < rhs.key() )
+ if ( lhs.key() < rhs.key())
return -1;
return lhs.key() > rhs.key() ? 1 : 0;
}
typedef cc::FeldmanHashMap< gc_type, key_type2, value_type, map_traits > map_type;
map_type m( 5, 3 );
- EXPECT_EQ( m.head_size(), static_cast<size_t>(1 << 6) );
- EXPECT_EQ( m.array_node_size(), static_cast<size_t>(1 << 3) );
+ EXPECT_EQ( m.head_size(), static_cast<size_t>(1 << 6));
+ EXPECT_EQ( m.array_node_size(), static_cast<size_t>(1 << 3));
test( m );
}
typedef cc::FeldmanHashMap< gc_type, key_type2, value_type, map_traits > map_type;
map_type m( 5, 3 );
- EXPECT_EQ( m.head_size(), static_cast<size_t>(1 << 6) );
- EXPECT_EQ( m.array_node_size(), static_cast<size_t>(1 << 3) );
+ EXPECT_EQ( m.head_size(), static_cast<size_t>(1 << 6));
+ EXPECT_EQ( m.array_node_size(), static_cast<size_t>(1 << 3));
test( m );
}
{}
explicit key_type2( std::string const& str )
- : nKey( std::stoi( str ) )
+ : nKey( std::stoi( str ))
, subkey( nKey )
{}
struct hash2 {
key_type2 operator()( int i ) const
{
- return key_type2( cds::opt::v::hash<int>()(i) );
+ return key_type2( cds::opt::v::hash<int>()(i));
}
key_type2 operator()( std::string const& str ) const
typedef cc::FeldmanHashMap< rcu_type, key_type2, value_type, map_traits > map_type;
map_type m( 5, 3 );
- EXPECT_EQ( m.head_size(), static_cast<size_t>(1 << 6) );
- EXPECT_EQ( m.array_node_size(), static_cast<size_t>(1 << 3) );
+ EXPECT_EQ( m.head_size(), static_cast<size_t>(1 << 6));
+ EXPECT_EQ( m.array_node_size(), static_cast<size_t>(1 << 3));
this->test( m );
}
int_item2( int k, std::string&& s )
: key_val( k, k * 2 )
- , strVal( std::move( s ) )
+ , strVal( std::move( s ))
{}
explicit int_item2( other_item const& s )
key_val operator()( other_item const& i ) const
{
- return key_val( i.key() );
+ return key_val( i.key());
}
key_val operator()( int i ) const
struct cmp2 {
int operator ()( key_val const& v1, key_val const& v2 ) const
{
- if ( v1.key() < v2.key() )
+ if ( v1.key() < v2.key())
return -1;
return v1.key() > v2.key() ? 1 : 0;
}