Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
p0mvn committed Dec 22, 2023
1 parent e931ef5 commit 3bd5551
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion x/incentives/keeper/distribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,11 @@ func (k Keeper) distributeSyntheticInternal(
}

sortedAndTrimmedQualifiedLocks := make([]*lockuptypes.PeriodLock, curIndex)
// This is not an issue because we directly
// use v.index and &v.locks. However, we must be careful not to
// take the address of &v.
// nolint: exportloopref
for _, v := range qualifiedLocksMap {
v := v
if v.index < 0 {
continue
}
Expand Down
6 changes: 3 additions & 3 deletions x/incentives/keeper/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ func (k Keeper) FinishedGaugesIterator(ctx sdk.Context) sdk.Iterator {
// FilterLocksByMinDuration returns locks whose lock duration is greater than the provided minimum duration.
func FilterLocksByMinDuration(locks []lockuptypes.PeriodLock, minDuration time.Duration) []*lockuptypes.PeriodLock {
filteredLocks := make([]*lockuptypes.PeriodLock, 0, len(locks))
for _, lock := range locks {
if lock.Duration >= minDuration {
filteredLocks = append(filteredLocks, &lock)
for i := range locks {
if locks[i].Duration >= minDuration {
filteredLocks = append(filteredLocks, &locks[i])
}
}
return filteredLocks
Expand Down

0 comments on commit 3bd5551

Please sign in to comment.