From be6e4b6f3c2592729a3396e48c43574c342bd1b9 Mon Sep 17 00:00:00 2001 From: Matthew Olsson Date: Sun, 23 May 2021 16:12:25 -0700 Subject: LibPDF: Store indirect value refs in Value objects IndirectValueRef is so simple that it can be stored directly in the Value class instead of being heap allocated. As the comment in Value says, however, in theory the max bits needed to store is 48 (16 for the generation index and 32(?) for the object index), but 32 should be good enough for now. We can increase it to u64 later if necessary. --- Userland/Libraries/LibPDF/Object.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'Userland/Libraries/LibPDF/Object.cpp') diff --git a/Userland/Libraries/LibPDF/Object.cpp b/Userland/Libraries/LibPDF/Object.cpp index 3cd861cb61..1b7921a092 100644 --- a/Userland/Libraries/LibPDF/Object.cpp +++ b/Userland/Libraries/LibPDF/Object.cpp @@ -30,7 +30,7 @@ NonnullRefPtr DictObject::get_object(Document* document, const FlyString { \ return document->resolve_to(get(key).value()); \ } -ENUMERATE_DIRECT_OBJECT_TYPES(DEFINE_ACCESSORS) +ENUMERATE_OBJECT_TYPES(DEFINE_ACCESSORS) #undef DEFINE_INDEXER static void append_indent(StringBuilder& builder, int indent) @@ -132,9 +132,4 @@ String IndirectValue::to_string(int indent) const return builder.to_string(); } -String IndirectValueRef::to_string(int) const -{ - return String::formatted("{} {} R", index(), generation_index()); -} - } -- cgit v1.2.3