소스 검색

LibGfx/TIFF: Take the TIFF value by rvalue reference in `handle_tag()`

Lucas CHOLLET 1 년 전
부모
커밋
1afdf7f3c7

+ 2 - 2
Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp

@@ -386,7 +386,7 @@ private:
         if (checked_size.has_overflow())
             return Error::from_string_literal("TIFFImageDecoderPlugin: Invalid tag with too large data");
 
-        auto const tiff_value = TRY(([=, this]() -> ErrorOr<Vector<Value>> {
+        auto tiff_value = TRY(([=, this]() -> ErrorOr<Vector<Value>> {
             if (checked_size.value() <= 4) {
                 auto value = TRY(read_tiff_value(type, count, TRY(m_stream->tell())));
                 TRY(m_stream->discard(4));
@@ -416,7 +416,7 @@ private:
             }
         }
 
-        TRY(handle_tag(m_metadata, tag, type, count, tiff_value));
+        TRY(handle_tag(m_metadata, tag, type, count, move(tiff_value)));
 
         return {};
     }

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

@@ -56,7 +56,7 @@ enum class Predictor {
     HorizontalDifferencing = 2,
 };
 
-ErrorOr<void> handle_tag(Metadata& metadata, u16 tag, Type type, u32 count, Vector<Value> const& value);
+ErrorOr<void> handle_tag(Metadata& metadata, u16 tag, Type type, u32 count, Vector<Value>&& value);
 
 }
 

+ 1 - 1
Userland/Libraries/LibGfx/ImageFormats/TIFFTagHandler.cpp

@@ -10,7 +10,7 @@
 
 namespace Gfx::TIFF {
 
-ErrorOr<void> handle_tag(Metadata& metadata, u16 tag, Type type, u32 count, Vector<Value> const& value)
+ErrorOr<void> handle_tag(Metadata& metadata, u16 tag, Type type, u32 count, Vector<Value>&& value)
 {
     // FIXME: Make that easy to extend
     switch (tag) {