Skip to content

Commit

Permalink
Code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
Groxan committed Mar 14, 2023
1 parent 494b6f1 commit 884a2bc
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Tzkt.Api/Parameters/ManagerOperationFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class ManagerOperationFilter : INormalizable
status == null &&
sender == null;

public virtual string Normalize(string prop)
public virtual string Normalize(string name)
{
return ResponseCacheService.BuildKey("",
("id", id), ("hash", hash), ("counter", counter), ("level", level),
Expand Down
2 changes: 1 addition & 1 deletion Tzkt.Api/Parameters/SrOperationFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class SrOperationFilter : ManagerOperationFilter

public override bool Empty => base.Empty && rollup == null;

public override string Normalize(string prop)
public override string Normalize(string name)
{
return ResponseCacheService.BuildKey("",
("id", id), ("hash", hash), ("counter", counter), ("level", level),
Expand Down
2 changes: 1 addition & 1 deletion Tzkt.Api/Parameters/SrRecoverBondOperationFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class SrRecoverBondOperationFilter : SrOperationFilter

public override bool Empty => base.Empty && staker == null && anyof == null;

public override string Normalize(string prop)
public override string Normalize(string name)
{
return ResponseCacheService.BuildKey("",
("id", id), ("hash", hash), ("counter", counter), ("level", level),
Expand Down
2 changes: 1 addition & 1 deletion Tzkt.Sync/Services/Cache/RefutationGameCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void Trim()
{
var toRemove = CachedByKey.Values
.OrderBy(x => x.LastLevel)
.Take(MaxItems / 2)
.Take(CachedByKey.Count - (int)(MaxItems * 0.75))
.ToList();

foreach (var item in toRemove)
Expand Down
2 changes: 1 addition & 1 deletion Tzkt.Sync/Services/Cache/SmartRollupCommitmentCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void Trim()
{
var toRemove = CachedByKey.Values
.OrderBy(x => x.LastLevel)
.Take(MaxItems / 2)
.Take(CachedByKey.Count - (int)(MaxItems * 0.75))
.ToList();

foreach (var item in toRemove)
Expand Down
2 changes: 1 addition & 1 deletion Tzkt.Sync/Services/Cache/SmartRollupStakesCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void Remove(int commitmentId, int stakerId)

public void Trim()
{
if (Cache.Count > Cache.Count)
if (Cache.Count > MaxItems)
{
var toRemove = Cache.Keys
.OrderBy(x => x)
Expand Down

0 comments on commit 884a2bc

Please sign in to comment.