1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

Remove the isRef helper function

This helper function is not really needed, since it's just a wrapper around a simple `instanceof` check, and it only adds unnecessary indirection in the code.
This commit is contained in:
Jonas Jenwald 2022-02-18 12:11:45 +01:00
parent df0aa1a9c4
commit 2cb2f633ac
10 changed files with 55 additions and 67 deletions

View file

@ -22,7 +22,7 @@ import {
stringToPDFString,
warn,
} from "../shared/util.js";
import { Dict, isName, isRef, RefSet } from "./primitives.js";
import { Dict, isName, Ref, RefSet } from "./primitives.js";
import { BaseStream } from "./base_stream.js";
function getLookupTableFactory(initializer) {
@ -316,7 +316,7 @@ function _collectJS(entry, xref, list, parents) {
}
let parent = null;
if (isRef(entry)) {
if (entry instanceof Ref) {
if (parents.has(entry)) {
// If we've already found entry then we've a cycle.
return;