Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#5773] AbstractByteBuf.forEachByteDesc(ByteProcessor) starts from wr…
…ong index Motivation: We introduced a regression in 1abdbe6 which let the iteration start from the wrong index. Modifications: Fix start index and add tests. Result: Fix regression.
- Loading branch information
1 parent
f97866d
commit 7ea5d04
Showing
4 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1274,7 +1274,7 @@ private int forEachByteAsc0(int start, int end, ByteProcessor processor) throws | |
public int forEachByteDesc(ByteProcessor processor) { | ||
ensureAccessible(); | ||
try { | ||
return forEachByteDesc0(writerIndex, readerIndex, processor); | ||
return forEachByteDesc0(writerIndex - 1, readerIndex, processor); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
normanmaurer
via email
Author
Member
|
||
} catch (Exception e) { | ||
PlatformDependent.throwException(e); | ||
return -1; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Based off the previous diff shouldn't this read