1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

LibGfx/CCITT: Make get_code_from_table take a generic Array

This commit is contained in:
Lucas CHOLLET 2024-02-14 23:08:54 -05:00 committed by Jelle Raaijmakers
parent d54dbdae5e
commit 3d63dd5c53

View file

@ -237,8 +237,8 @@ constexpr Array common_make_up_codes = {
Code { 2560, 12, 0b000000011111 },
};
template<size_t Size>
Optional<Code> get_code_from_table(Array<Code, Size> const& array, u16 code_word, u8 code_size)
template<typename T, size_t Size>
Optional<T> get_code_from_table(Array<T, Size> const& array, u16 code_word, u8 code_size)
{
for (auto const& code : array) {
if (code.code_length == code_size && code.code == code_word)