From 2a60352e24518c943827547243a80f688bfb8c96 Mon Sep 17 00:00:00 2001 From: Andreas Gal Date: Mon, 9 May 2011 23:37:21 -0700 Subject: [PATCH] inline asString since its only used once --- pdf.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/pdf.js b/pdf.js index 4a13c74f5..bce53c8a9 100644 --- a/pdf.js +++ b/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; }