Skip to content

Commit

Permalink
bool fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ZsoltGajdacs committed Feb 15, 2021
1 parent 07b9280 commit 6b702d5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Model/HighPrecisionUsageKeeper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,22 @@ public List<UsageBlock> NotUsageListForGivenTimeFrame(DateTime startTime, DateTi
{
isValueWrittenInRound = false;

if (notUsageBlock.StartTime == default && notUsageBlock.EndTime == default && isValueWrittenInRound == false)
if (notUsageBlock.StartTime == default && notUsageBlock.EndTime == default
&& !isValueWrittenInRound)
{
notUsageBlock.StartTime = block.EndTime;
isValueWrittenInRound = true;
}

if (notUsageBlock.EndTime == default && notUsageBlock.StartTime != default && isValueWrittenInRound == false)
if (notUsageBlock.EndTime == default && notUsageBlock.StartTime != default
&& !isValueWrittenInRound)
{
notUsageBlock.EndTime = block.StartTime;
isValueWrittenInRound = true;
}

if (notUsageBlock.StartTime != default && notUsageBlock.EndTime != default && isValueWrittenInRound == true)
if (notUsageBlock.StartTime != default && notUsageBlock.EndTime != default
&& isValueWrittenInRound)
{
notUsageList.Add(notUsageBlock);
notUsageBlock = new UsageBlock
Expand Down

0 comments on commit 6b702d5

Please sign in to comment.