Skip to content

Commit

Permalink
os: avoid unnecessary usage of var
Browse files Browse the repository at this point in the history
The `var` keyword is known to be problematic and is not needed here,
so better to use the `let` keyword for variable declarations.

PR-URL: #42563
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Akhil Marsonya <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
VoltrexKeyva authored and juanarbol committed Apr 4, 2022
1 parent dea7f22 commit 0fcb067
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/os.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ platform[SymbolToPrimitive] = () => process.platform;
* @returns {string}
*/
function tmpdir() {
var path;
let path;
if (isWindows) {
path = process.env.TEMP ||
process.env.TMP ||
Expand Down Expand Up @@ -223,7 +223,7 @@ function getCIDR(address, netmask, family) {
}

const parts = StringPrototypeSplit(netmask, split);
for (var i = 0; i < parts.length; i++) {
for (let i = 0; i < parts.length; i++) {
if (parts[i] !== '') {
const binary = NumberParseInt(parts[i], range);
const tmp = countBinaryOnes(binary);
Expand Down Expand Up @@ -261,7 +261,7 @@ function networkInterfaces() {

if (data === undefined)
return result;
for (var i = 0; i < data.length; i += 7) {
for (let i = 0; i < data.length; i += 7) {
const name = data[i];
const entry = {
address: data[i + 1],
Expand Down

0 comments on commit 0fcb067

Please sign in to comment.