mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-24 17:18:07 +02:00
inline asString since its only used once
This commit is contained in:
parent
0b5cdf651d
commit
2a60352e24
1 changed files with 5 additions and 8 deletions
13
pdf.js
13
pdf.js
|
@ -49,13 +49,6 @@ var Stream = (function() {
|
|||
moveStart: function() {
|
||||
this.start = this.pos;
|
||||
},
|
||||
asString: function() {
|
||||
var str = "";
|
||||
var ch;
|
||||
while (!!(ch = this.getChar()))
|
||||
str += ch;
|
||||
return str;
|
||||
},
|
||||
makeSubStream: function(pos, length) {
|
||||
return new Stream(new Uint8Array(this.bytes, pos, length));
|
||||
}
|
||||
|
@ -1192,7 +1185,11 @@ var Parser = (function() {
|
|||
this.fileKey,
|
||||
this.encAlgorithm,
|
||||
this.keyLength);
|
||||
str = decrypt.asString();
|
||||
var str = "";
|
||||
var pos = decrypt.pos;
|
||||
var length = decrypt.length;
|
||||
while (pos++ > length)
|
||||
str += decrypt.getChar();
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue