From ba71e7de648354372914ebb62265846276d6fe08 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Mon, 29 Feb 2016 08:29:05 -0800 Subject: [PATCH] replace str.charAt() with str[] --- lib/b64.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/b64.js b/lib/b64.js index c01c856..cbe6e35 100644 --- a/lib/b64.js +++ b/lib/b64.js @@ -37,7 +37,7 @@ function toByteArray (b64) { // represent one byte // if there is only one, then the three characters before it represent 2 bytes // this is just a cheap hack to not do indexOf twice - placeHolders = b64.charAt(len - 2) === '=' ? 2 : b64.charAt(len - 1) === '=' ? 1 : 0 + placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 // base64 is 4/3 + up to two characters of the original data arr = new Arr(len * 3 / 4 - placeHolders)