From fa286a6fb3dd3c0d1621abf9282b835da9c00a48 Mon Sep 17 00:00:00 2001 From: orignal Date: Tue, 14 Feb 2023 19:49:29 -0500 Subject: [PATCH] faster GetBit --- libi2pd/Tag.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libi2pd/Tag.h b/libi2pd/Tag.h index d0b0c056..72f181a2 100644 --- a/libi2pd/Tag.h +++ b/libi2pd/Tag.h @@ -83,8 +83,8 @@ namespace data { uint8_t GetBit (int i) const { int pos = i >> 3; // /8 - if (pos >= sz) return 0; - return m_Buf[pos] & (1 << (7 - (i & 0x07))); + if (pos >= (int)sz) return 0; + return m_Buf[pos] & (0x80 >> (i & 0x07)); } private: