mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
faster GetBit
This commit is contained in:
parent
02a36a9fa8
commit
fa286a6fb3
|
@ -83,8 +83,8 @@ namespace data {
|
||||||
uint8_t GetBit (int i) const
|
uint8_t GetBit (int i) const
|
||||||
{
|
{
|
||||||
int pos = i >> 3; // /8
|
int pos = i >> 3; // /8
|
||||||
if (pos >= sz) return 0;
|
if (pos >= (int)sz) return 0;
|
||||||
return m_Buf[pos] & (1 << (7 - (i & 0x07)));
|
return m_Buf[pos] & (0x80 >> (i & 0x07));
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue