mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibGfx/CCITT: Make get_code_from_table take a generic Array
This commit is contained in:
committed by
Jelle Raaijmakers
parent
d54dbdae5e
commit
3d63dd5c53
Notes:
sideshowbarker
2024-07-17 03:03:37 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/3d63dd5c53 Pull-request: https://github.com/SerenityOS/serenity/pull/23222 Reviewed-by: https://github.com/nico ✅
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user