mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:07:35 +00:00
LibGfx/PortableFormat: Use FixedArray::unchecked_at
This allows us to drop from 7% to 5% passed on `add_pixels` when using `image` to do conversions from JPEG to PPM.
This commit is contained in:
parent
4a2ef231b8
commit
a08de19922
1 changed files with 3 additions and 3 deletions
|
@ -39,9 +39,9 @@ ErrorOr<void> PortableFormatWriter::add_pixels(Stream& output, Options const& op
|
|||
for (int j = 0; j < bitmap.width(); ++j) {
|
||||
auto const color = bitmap.get_pixel(j, i);
|
||||
|
||||
row[j * 3 + 0] = color.red();
|
||||
row[j * 3 + 1] = color.green();
|
||||
row[j * 3 + 2] = color.blue();
|
||||
row.unchecked_at(j * 3 + 0) = color.red();
|
||||
row.unchecked_at(j * 3 + 1) = color.green();
|
||||
row.unchecked_at(j * 3 + 2) = color.blue();
|
||||
}
|
||||
|
||||
TRY(output.write_until_depleted(row.span()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue