Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: tracing/tracing/base/base64.html

Issue 2776653002: [ESLint] Fix violations when enabling curly rule in eslint. (Closed)
Patch Set: rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tracing/tracing/base/base.html ('k') | tracing/tracing/base/base64_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/base/base64.html
diff --git a/tracing/tracing/base/base64.html b/tracing/tracing/base/base64.html
index ce2b28ef11fb04e0d63f03d495a0a41f05772228..f1288f40d529c698ba5b85ca7aa48509861914bb 100644
--- a/tracing/tracing/base/base64.html
+++ b/tracing/tracing/base/base64.html
@@ -13,16 +13,11 @@ tr.exportTo('tr.b', function() {
}
function b64ToUint6(nChr) {
- if (nChr > 64 && nChr < 91)
- return nChr - 65;
- if (nChr > 96 && nChr < 123)
- return nChr - 71;
- if (nChr > 47 && nChr < 58)
- return nChr + 4;
- if (nChr === 43)
- return 62;
- if (nChr === 47)
- return 63;
+ if (nChr > 64 && nChr < 91) return nChr - 65;
+ if (nChr > 96 && nChr < 123) return nChr - 71;
+ if (nChr > 47 && nChr < 58) return nChr + 4;
+ if (nChr === 43) return 62;
+ if (nChr === 47) return 63;
return 0;
}
@@ -35,8 +30,9 @@ tr.exportTo('tr.b', function() {
var binary = '';
var bytes = new Uint8Array(input);
var len = bytes.byteLength;
- for (var i = 0; i < len; i++)
+ for (var i = 0; i < len; i++) {
binary += String.fromCharCode(bytes[i]);
+ }
return btoa(binary);
};
@@ -48,8 +44,9 @@ tr.exportTo('tr.b', function() {
var nUint24 = 0;
var nOutIdx = 0;
- if (nOutLen > output.byteLength)
+ if (nOutLen > output.byteLength) {
throw new Error('Output buffer too small to decode.');
+ }
for (var nInIdx = 0; nInIdx < nInLen; nInIdx++) {
nMod4 = nInIdx & 3;
« no previous file with comments | « tracing/tracing/base/base.html ('k') | tracing/tracing/base/base64_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698