From 9f428845078bcff045c9f8ccfa98f6d470992e5b Mon Sep 17 00:00:00 2001 From: Veloman Yunkan Date: Thu, 18 Nov 2021 14:23:59 +0400 Subject: [PATCH] Book's illustrations are now immutable --- include/book.h | 2 +- src/book.cpp | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/book.h b/include/book.h index 4a8c8a7d2..7dc1ed8c5 100644 --- a/include/book.h +++ b/include/book.h @@ -142,7 +142,7 @@ class Book uint64_t m_mediaCount = 0; bool m_readOnly = false; uint64_t m_size = 0; - std::vector> m_illustrations; + std::vector> m_illustrations; // Used as the return value of getDefaultIllustration() when no default // illustration is found in the book diff --git a/src/book.cpp b/src/book.cpp index 35370bfff..73063a141 100644 --- a/src/book.cpp +++ b/src/book.cpp @@ -73,11 +73,7 @@ bool Book::update(const kiwix::Book& other) m_articleCount = other.m_articleCount; m_mediaCount = other.m_mediaCount; m_size = other.m_size; - m_illustrations.clear(); - for ( const auto& ill : other.m_illustrations ) { - m_illustrations.push_back(std::make_shared(*ill)); - } - + m_illustrations = other.m_illustrations; m_downloadId = other.m_downloadId; return true;