]> git.parisson.com Git - pdf.js.git/commitdiff
inline asString since its only used once
authorAndreas Gal <andreas.gal@gmail.com>
Tue, 10 May 2011 06:37:21 +0000 (23:37 -0700)
committerAndreas Gal <andreas.gal@gmail.com>
Tue, 10 May 2011 06:37:21 +0000 (23:37 -0700)
pdf.js

diff --git a/pdf.js b/pdf.js
index 4a13c74f5e9787759e6d8d6ff970510c714de6a1..bce53c8a9cc8d7f79330c0677dcf04caaced6d95 100644 (file)
--- 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;
             }