mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 04:13:11 +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
|
@ -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…
Reference in a new issue