From 4e5eb59a330acca43bb76a24742b046f898a49f3 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sun, 18 Feb 2018 20:13:50 +0100 Subject: [PATCH] Remove the `getPageProp` method in `src/core/document.js` It's only used in two places in the class and those callsites can directly get the information from the dictionary, which is more readable and avoids an additional method call. --- src/core/document.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/core/document.js b/src/core/document.js index ea2e03263..7ef67855c 100644 --- a/src/core/document.js +++ b/src/core/document.js @@ -62,10 +62,6 @@ var Page = (function PageClosure() { } Page.prototype = { - getPageProp: function Page_getPageProp(key) { - return this.pageDict.get(key); - }, - getInheritedPageProp: function Page_getInheritedPageProp(key, getArray) { var dict = this.pageDict, valueArray = null, loopCount = 0; var MAX_LOOP_COUNT = 100; @@ -96,7 +92,7 @@ var Page = (function PageClosure() { }, get content() { - return this.getPageProp('Contents'); + return this.pageDict.get('Contents'); }, get resources() { @@ -126,7 +122,7 @@ var Page = (function PageClosure() { }, get userUnit() { - var obj = this.getPageProp('UserUnit'); + var obj = this.pageDict.get('UserUnit'); if (!isNum(obj) || obj <= 0) { obj = DEFAULT_USER_UNIT; }