sample: fix lint issues in penalty sampler

This commit is contained in:
jmorganca
2026-03-10 22:08:39 -07:00
parent 4ad9f16d68
commit 7563f51fdf
2 changed files with 3 additions and 3 deletions

View File

@@ -68,7 +68,7 @@ func (s Sampler) PenalizesHistory() bool {
}
func (s *Sampler) applyHistoryPenalties(tokens []token) {
if s.counts == nil || len(s.counts) == 0 {
if len(s.counts) == 0 {
return
}

View File

@@ -66,7 +66,7 @@ func TestSamplerNoopPenaltiesSkipHistory(t *testing.T) {
t.Fatal("expected no-op penalties to disable history tracking")
}
for i := 0; i < DefaultPenaltyLookback+10; i++ {
for range DefaultPenaltyLookback + 10 {
sampler.Accept(1)
}
@@ -85,7 +85,7 @@ func TestSamplerActivePenaltiesTrackLookback(t *testing.T) {
t.Fatal("expected non-default penalties to enable history tracking")
}
for i := 0; i < DefaultPenaltyLookback+10; i++ {
for range DefaultPenaltyLookback + 10 {
sampler.Accept(7)
}