SysStat: fixed warning. cant assign undefined to real
This commit is contained in:
parent
f27608947c
commit
9010a1668b
1 changed files with 3 additions and 3 deletions
|
|
@ -27,8 +27,8 @@ Singleton {
|
||||||
// Internal state for network speed calculation
|
// Internal state for network speed calculation
|
||||||
// Previous Bytes need to be stored as 'real' as they represent the total of bytes transfered
|
// Previous Bytes need to be stored as 'real' as they represent the total of bytes transfered
|
||||||
// since the computer started, so their value will easily overlfow a 32bit int.
|
// since the computer started, so their value will easily overlfow a 32bit int.
|
||||||
property real prevRxBytes: undefined
|
property real prevRxBytes: 0
|
||||||
property real prevTxBytes: undefined
|
property real prevTxBytes: 0
|
||||||
property real prevTime: 0
|
property real prevTime: 0
|
||||||
|
|
||||||
// Cpu temperature is the most complex
|
// Cpu temperature is the most complex
|
||||||
|
|
@ -292,7 +292,7 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Compute only if we have a previous run to compare to.
|
// Compute only if we have a previous run to compare to.
|
||||||
if (root.prevTime > 0 && root.prevRxBytes !== undefined) {
|
if (root.prevTime > 0) {
|
||||||
const timeDiff = currentTime - root.prevTime
|
const timeDiff = currentTime - root.prevTime
|
||||||
|
|
||||||
// Avoid division by zero if time hasn't passed.
|
// Avoid division by zero if time hasn't passed.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue