Skip to content
Snippets Groups Projects
Commit 98727baf authored by Jorge Camarero Vera's avatar Jorge Camarero Vera
Browse files

Use of ternary operator for a more concise and readable notation

parent 7fa809ee
No related branches found
No related tags found
No related merge requests found
......@@ -117,9 +117,8 @@ void TapeDrivesCatalogueState::updateDriveStatistics(const common::dataStructure
case common::dataStructures::DriveStatus::Transferring:
{
const time_t timeDifference = inputs.reportTime - driveState.value().lastModificationLog.value().time;
uint64_t bytesTransferedInSession = 0;
if (driveState.value().bytesTransferedInSession)
bytesTransferedInSession = driveState.value().bytesTransferedInSession.value();
uint64_t bytesTransferedInSession = driveState.value().bytesTransferedInSession ?
driveState.value().bytesTransferedInSession.value() : 0;
const uint64_t bytesDifference = inputs.bytesTransferred - bytesTransferedInSession;
driveState.value().lastModificationLog = common::dataStructures::EntryLog(
"NO_USER", driveInfo.host, inputs.reportTime);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment