mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-29 06:26:59 +00:00
Fixes: Regard int() as int32() by default, which should be a coding standard (#7155)
https://github.com/XTLS/Xray-core/pull/7155#issuecomment-6208455069 Fixes https://github.com/XTLS/Xray-core/pull/7148#issuecomment-6173633056 --------- Co-authored-by: Denis Orlov <freshcrowd@gmail.com> Co-authored-by: Milomilo777 <117558067+Milomilo777@users.noreply.github.com>
This commit is contained in:
co-authored by
Denis Orlov
Milomilo777
parent
206a24a9f0
commit
d15966c76c
@@ -49,12 +49,12 @@ func (f *SlidingWindow) Add(counter uint64) {
|
||||
|
||||
if counter > f.last {
|
||||
lastBlockIndex := f.last >> swBlockBitLog
|
||||
diff := int(blockIndex - lastBlockIndex)
|
||||
diff := blockIndex - lastBlockIndex
|
||||
if diff > swRingBlocks {
|
||||
diff = swRingBlocks
|
||||
}
|
||||
|
||||
for i := 0; i < diff; i++ {
|
||||
for i := 0; i < int(diff); i++ {
|
||||
lastBlockIndex = (lastBlockIndex + 1) & swBlockMask
|
||||
f.ring[lastBlockIndex] = 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user