diff options
author | Matthew Olsson <matthewcolsson@gmail.com> | 2021-05-23 16:12:25 -0700 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-05-25 00:24:09 +0430 |
commit | be6e4b6f3c2592729a3396e48c43574c342bd1b9 (patch) | |
tree | 914bba7b86255282ff799fc087f2dac82f55f49a /Userland/Libraries/LibPDF/Object.cpp | |
parent | 534a2e95d2a0d8cb9d3a4ba1644089b9ea8221ca (diff) | |
download | serenity-be6e4b6f3c2592729a3396e48c43574c342bd1b9.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibPDF/Object.cpp')
-rw-r--r-- | Userland/Libraries/LibPDF/Object.cpp | 7 |
1 files changed, 1 insertions, 6 deletions
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<Object> DictObject::get_object(Document* document, const FlyString { \ return document->resolve_to<class_name>(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()); -} - } |