Remove some unused assignments

Mainly to keep eslint happy with its new recommended rules. But it also
makes the code more clear to not have unused stuff in it.

The des code got a bit more refactoring since eslint was upset about the
final "i++" as it was technically an unused assignment.
This commit is contained in:
Pierre Ossman
2026-02-13 12:33:11 +01:00
parent 4d16cc5270
commit 8e1ebdffba
4 changed files with 7 additions and 9 deletions

View File

@@ -138,10 +138,8 @@ const UI = {
let autoconnect = UI.getSetting('autoconnect');
if (autoconnect === 'true' || autoconnect == '1') {
autoconnect = true;
UI.connect();
} else {
autoconnect = false;
// Show the connect panel on first load unless autoconnecting
UI.openConnectPanel();
}
@@ -1213,7 +1211,7 @@ const UI = {
},
securityFailed(e) {
let msg = "";
let msg;
// On security failures we might get a string with a reason
// directly from the server. Note that we can't control if
// this string is translated or not.

View File

@@ -181,11 +181,11 @@ class DES {
// Encrypt 8 bytes of text
enc8(text) {
const b = text.slice();
let i = 0, l, r, x; // left, right, accumulator
let l, r, x; // left, right, accumulator
// Squash 8 bytes to 2 ints
l = b[i++]<<24 | b[i++]<<16 | b[i++]<<8 | b[i++];
r = b[i++]<<24 | b[i++]<<16 | b[i++]<<8 | b[i++];
l = b[0]<<24 | b[1]<<16 | b[2]<<8 | b[3];
r = b[4]<<24 | b[5]<<16 | b[6]<<8 | b[7];
x = ((l >>> 4) ^ r) & 0x0f0f0f0f;
r ^= x;
@@ -252,7 +252,7 @@ class DES {
// Spread ints to bytes
x = [r, l];
for (i = 0; i < 8; i++) {
for (let i = 0; i < 8; i++) {
b[i] = (x[i>>>2] >>> (8 * (3 - (i % 4)))) % 256;
if (b[i] < 0) { b[i] += 256; } // unsigned
}

View File

@@ -175,7 +175,7 @@ export default class ZRLEDecoder {
_readRLELength() {
let length = 0;
let current = 0;
let current;
do {
current = this._inflator.inflate(1)[0];
length += current;

View File

@@ -2949,7 +2949,7 @@ export default class RFB extends EventTargetMixin {
// We need to handle errors when we requested the resize.
if (this._FBU.x === 1 && this._FBU.y !== 0) {
let msg = "";
let msg;
// The y-position indicates the status code from the server
switch (this._FBU.y) {
case 1: