mirror of
https://gitlab.com/AutumnMeowMeow/jexer
synced 2024-09-19 11:50:19 -06:00
hoist shift out of loop
This commit is contained in:
parent
dbc993b48f
commit
3b73cc28cd
2 changed files with 4 additions and 2 deletions
|
@ -1938,10 +1938,11 @@ public class HQSixelEncoder implements SixelEncoder {
|
|||
j++) {
|
||||
|
||||
int base = width * (currentRow + j);
|
||||
int value = 1 << j;
|
||||
for (int imageX = 0; imageX < width; imageX++) {
|
||||
// Is there was a way to do this without the if?
|
||||
if (rgbArray[base + imageX] == i) {
|
||||
row[imageX] += 1 << j;
|
||||
row[imageX] += value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -901,10 +901,11 @@ public class LegacySixelEncoder implements SixelEncoder {
|
|||
j++) {
|
||||
|
||||
int base = width * (currentRow + j);
|
||||
int value = 1 << j;
|
||||
for (int imageX = 0; imageX < width; imageX++) {
|
||||
// Is there was a way to do this without the if?
|
||||
if (rgbArray[base + imageX] == i) {
|
||||
row[imageX] += 1 << j;
|
||||
row[imageX] += value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue