reduced scope of constants
This commit is contained in:
+7
-7
@@ -29,12 +29,6 @@ private:
|
||||
ca_uint8_t pri;
|
||||
};
|
||||
|
||||
// start with a very small server table to speed
|
||||
// up the flush traverse for the frequent case -
|
||||
// a small numbers of servers
|
||||
static const unsigned caServerMinIndexBitWidth = 2u;
|
||||
static const unsigned caServerMaxIndexBitWidth = 32u;
|
||||
|
||||
inline caServerID::caServerID (
|
||||
const struct sockaddr_in & addrIn, unsigned priorityIn ) :
|
||||
addr ( addrIn ), pri ( static_cast <ca_uint8_t> ( priorityIn ) )
|
||||
@@ -56,12 +50,18 @@ inline bool caServerID::operator == ( const caServerID & rhs ) const
|
||||
|
||||
inline resTableIndex caServerID::hash () const
|
||||
{
|
||||
// start with a very small server table to speed
|
||||
// up the flush traverse for the frequent case -
|
||||
// a small numbers of servers
|
||||
const unsigned caServerMinIndexBitWidth = 2u;
|
||||
const unsigned caServerMaxIndexBitWidth = 32u;
|
||||
|
||||
unsigned index;
|
||||
index = this->addr.sin_addr.s_addr;
|
||||
index ^= this->addr.sin_port;
|
||||
index ^= this->addr.sin_port >> 8u;
|
||||
index ^= this->pri;
|
||||
return integerHash( caServerMinIndexBitWidth,
|
||||
return integerHash ( caServerMinIndexBitWidth,
|
||||
caServerMaxIndexBitWidth, index );
|
||||
}
|
||||
|
||||
|
||||
+2
-3
@@ -26,9 +26,6 @@ private:
|
||||
struct sockaddr_in addr;
|
||||
};
|
||||
|
||||
static const unsigned inetAddrMinIndexBitWidth = 8u;
|
||||
static const unsigned inetAddrMaxIndexBitWidth = 32u;
|
||||
|
||||
inline inetAddrID::inetAddrID ( const struct sockaddr_in & addrIn ) :
|
||||
addr ( addrIn )
|
||||
{
|
||||
@@ -46,6 +43,8 @@ inline bool inetAddrID::operator == ( const inetAddrID &rhs ) const
|
||||
|
||||
inline resTableIndex inetAddrID::hash () const
|
||||
{
|
||||
const unsigned inetAddrMinIndexBitWidth = 8u;
|
||||
const unsigned inetAddrMaxIndexBitWidth = 32u;
|
||||
unsigned index;
|
||||
index = this->addr.sin_addr.s_addr;
|
||||
index ^= this->addr.sin_port;
|
||||
|
||||
Reference in New Issue
Block a user