refactor: Use fixed-size integers for BookMetadataCache data (#1844)

This commit is contained in:
Zach Nelson
2026-05-07 09:03:51 +03:00
committed by GitHub
parent 395e68ea2b
commit 11bc36ebb5
+3 -3
View File
@@ -18,11 +18,11 @@ class BookMetadataCache {
struct SpineEntry { struct SpineEntry {
std::string href; std::string href;
size_t cumulativeSize; uint32_t cumulativeSize;
int16_t tocIndex; int16_t tocIndex;
SpineEntry() : cumulativeSize(0), tocIndex(-1) {} SpineEntry() : cumulativeSize(0), tocIndex(-1) {}
SpineEntry(std::string href, const size_t cumulativeSize, const int16_t tocIndex) SpineEntry(std::string href, const uint32_t cumulativeSize, const int16_t tocIndex)
: href(std::move(href)), cumulativeSize(cumulativeSize), tocIndex(tocIndex) {} : href(std::move(href)), cumulativeSize(cumulativeSize), tocIndex(tocIndex) {}
}; };
@@ -44,7 +44,7 @@ class BookMetadataCache {
private: private:
std::string cachePath; std::string cachePath;
size_t lutOffset; uint32_t lutOffset;
uint16_t spineCount; uint16_t spineCount;
uint16_t tocCount; uint16_t tocCount;
bool loaded; bool loaded;