mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08: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:
parent
df0aa1a9c4
commit
2cb2f633ac
10 changed files with 55 additions and 67 deletions
|
@ -44,7 +44,7 @@ import {
|
|||
XRefEntryException,
|
||||
XRefParseException,
|
||||
} from "./core_utils.js";
|
||||
import { Dict, isDict, isName, isRef, Name, Ref } from "./primitives.js";
|
||||
import { Dict, isDict, isName, Name, Ref } from "./primitives.js";
|
||||
import { getXfaFontDict, getXfaFontName } from "./xfa_fonts.js";
|
||||
import { NullStream, Stream } from "./stream.js";
|
||||
import { AnnotationFactory } from "./annotation.js";
|
||||
|
@ -1548,7 +1548,12 @@ class PDFDocument {
|
|||
return shadow(this, "calculationOrderIds", null);
|
||||
}
|
||||
|
||||
const ids = calculationOrder.filter(isRef).map(ref => ref.toString());
|
||||
const ids = [];
|
||||
for (const id of calculationOrder) {
|
||||
if (id instanceof Ref) {
|
||||
ids.push(id.toString());
|
||||
}
|
||||
}
|
||||
if (ids.length === 0) {
|
||||
return shadow(this, "calculationOrderIds", null);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue