code optimization from @nutki

Co-Authored-By: Michał Szafrański <szafranski@gmail.com>
This commit is contained in:
Léo Bonnargent 2019-11-13 22:13:49 +01:00 committed by GitHub
parent 7c23bd437f
commit 1d575cf63c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ export class LPF2Hub extends Hub {
}
private static decodeMacAddress(v: Uint8Array) {
return Array.from(v).map((n) => ("00" + n.toString(16)).slice(-2)).join(":");
return Array.from(v).map((n) => n.toString(16).padStart(2, "0")).join(":");
}
protected _ledPort: number = 0x32;