Only allow one statement per line.

With the new style rule, we cannot have two statements on the same line.
So we can no longer have an "if" on a single line and we cannot have
an arrow function with a body on the same line as when it is used.
This is mostly a manual change.

Change-Id: I2285202dd5ecbad764308bc725e6d317ff2ee7f0
This commit is contained in:
Jacob Trimble
2019-05-09 09:38:44 -07:00
parent 984bb6f340
commit 0dd64074b9
87 changed files with 989 additions and 394 deletions
+15 -5
View File
@@ -98,7 +98,9 @@ shaka.util.Uint8ArrayUtils.toHex = function(arr) {
let hex = '';
for (let i = 0; i < arr.length; ++i) {
let value = arr[i].toString(16);
if (value.length == 1) value = '0' + value;
if (value.length == 1) {
value = '0' + value;
}
hex += value;
}
return hex;
@@ -113,11 +115,19 @@ shaka.util.Uint8ArrayUtils.toHex = function(arr) {
* @export
*/
shaka.util.Uint8ArrayUtils.equal = function(arr1, arr2) {
if (!arr1 && !arr2) return true;
if (!arr1 || !arr2) return false;
if (arr1.length != arr2.length) return false;
if (!arr1 && !arr2) {
return true;
}
if (!arr1 || !arr2) {
return false;
}
if (arr1.length != arr2.length) {
return false;
}
for (let i = 0; i < arr1.length; ++i) {
if (arr1[i] != arr2[i]) return false;
if (arr1[i] != arr2[i]) {
return false;
}
}
return true;
};