Prechádzať zdrojové kódy

LibGfx/ICO: Remove unused parameter

Lucas CHOLLET 1 rok pred
rodič
commit
15d151ee66

+ 3 - 5
Userland/Libraries/LibGfx/ImageFormats/ICOLoader.cpp

@@ -136,13 +136,11 @@ static ErrorOr<void> load_ico_directory(ICOLoadingContext& context)
     return {};
     return {};
 }
 }
 
 
-ErrorOr<void> ICOImageDecoderPlugin::load_ico_bitmap(ICOLoadingContext& context, Optional<size_t> index)
+ErrorOr<void> ICOImageDecoderPlugin::load_ico_bitmap(ICOLoadingContext& context)
 {
 {
     VERIFY(context.state >= ICOLoadingContext::State::DirectoryDecoded);
     VERIFY(context.state >= ICOLoadingContext::State::DirectoryDecoded);
 
 
-    size_t real_index = context.largest_index;
-    if (index.has_value())
-        real_index = index.value();
+    size_t const real_index = context.largest_index;
     if (real_index >= context.images.size())
     if (real_index >= context.images.size())
         return Error::from_string_literal("Index out of bounds");
         return Error::from_string_literal("Index out of bounds");
 
 
@@ -213,7 +211,7 @@ ErrorOr<ImageFrameDescriptor> ICOImageDecoderPlugin::frame(size_t index, Optiona
 
 
     if (m_context->state < ICOLoadingContext::State::BitmapDecoded) {
     if (m_context->state < ICOLoadingContext::State::BitmapDecoded) {
         // NOTE: This forces the chunk decoding to happen.
         // NOTE: This forces the chunk decoding to happen.
-        auto maybe_error = load_ico_bitmap(*m_context, {});
+        auto maybe_error = load_ico_bitmap(*m_context);
         if (maybe_error.is_error()) {
         if (maybe_error.is_error()) {
             m_context->state = ICOLoadingContext::State::Error;
             m_context->state = ICOLoadingContext::State::Error;
             return Error::from_string_literal("ICOImageDecoderPlugin: Decoding failed");
             return Error::from_string_literal("ICOImageDecoderPlugin: Decoding failed");

+ 1 - 1
Userland/Libraries/LibGfx/ImageFormats/ICOLoader.h

@@ -25,7 +25,7 @@ public:
 
 
 private:
 private:
     ICOImageDecoderPlugin(u8 const*, size_t);
     ICOImageDecoderPlugin(u8 const*, size_t);
-    static ErrorOr<void> load_ico_bitmap(ICOLoadingContext& context, Optional<size_t> index);
+    static ErrorOr<void> load_ico_bitmap(ICOLoadingContext& context);
 
 
     OwnPtr<ICOLoadingContext> m_context;
     OwnPtr<ICOLoadingContext> m_context;
 };
 };