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.
This commit is contained in:
Tim van der Meij 2018-02-18 20:13:50 +01:00
parent c33bf800cc
commit 4e5eb59a33
No known key found for this signature in database
GPG Key ID: 8C3FD2925A5F2762

View File

@ -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;
}