removed redundant code

This commit is contained in:
Sebastian Hildebrandt 2017-09-01 15:15:43 +02:00
parent 01f17da1ae
commit c050f7f969
2 changed files with 3 additions and 6 deletions

View File

@ -98,6 +98,7 @@ Other changes
| Version | Date | Comment |
| -------------- | -------------- | -------- |
| 3.26.2 | 2017-09-01 | removed redundant code |
| 3.26.1 | 2017-08-23 | fixed `cpu().speed` windows / AMD, updated docs |
| 3.26.0 | 2017-08-21 | extended `getDynamicData()` (windows), updated docs |
| 3.25.1 | 2017-08-07 | updated docs |

View File

@ -139,16 +139,14 @@ function calcNetworkSpeed(iface, rx, tx, operstate) {
let result = {
iface: iface,
operstate: operstate,
rx: 0,
tx: 0,
rx: rx,
tx: tx,
rx_sec: -1,
tx_sec: -1,
ms: 0
};
if (_network[iface] && _network[iface].ms) {
result.rx = rx;
result.tx = tx;
result.ms = Date.now() - _network[iface].ms;
result.rx_sec = (rx - _network[iface].rx) / (result.ms / 1000);
result.tx_sec = (tx - _network[iface].tx) / (result.ms / 1000);
@ -159,8 +157,6 @@ function calcNetworkSpeed(iface, rx, tx, operstate) {
_network[iface].ms = Date.now();
_network[iface].last_ms = result.ms;
} else {
result.rx = rx;
result.tx = tx;
if (!_network[iface]) _network[iface] = {};
_network[iface].rx = rx;
_network[iface].tx = tx;