Skip to content

Commit

Permalink
remove S1066 [skip changelog]
Browse files Browse the repository at this point in the history
  • Loading branch information
Oaroomy committed Dec 14, 2019
1 parent f5b3aa4 commit 9cd3212
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 0 additions & 2 deletions Libplanet.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@
other handling the asynchronous code. -->
<Rule Id="S4457" Action="None" />

<!-- Merge this if statement with the enclosing one. -->
<Rule Id="S1066" Action="None" />
<!-- Remove the unnecessary Boolean literal(s). -->
<Rule Id="S1125" Action="None" />
<!-- Remove the field '_bucketSize' and declare it as a local variable
Expand Down
7 changes: 2 additions & 5 deletions Libplanet/Store/DefaultStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -660,12 +660,9 @@ public override IEnumerable<KeyValuePair<Address, long>> ListTxNonces(Guid chain
if (doc.TryGetValue("_id", out BsonValue id) && id.IsBinary)
{
var address = new Address(id.AsBinary);
if (doc.TryGetValue("v", out BsonValue v) && v.IsInt64)
if (doc.TryGetValue("v", out BsonValue v) && v.IsInt64 && v.AsInt64 > 0)
{
if (v.AsInt64 > 0)
{
yield return new KeyValuePair<Address, long>(address, v.AsInt64);
}
yield return new KeyValuePair<Address, long>(address, v.AsInt64);
}
}
}
Expand Down

0 comments on commit 9cd3212

Please sign in to comment.