Skip to content

Commit 0e67b71

Browse files
committed
tidy up debugging cruft
1 parent 4e08bd4 commit 0e67b71

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

lib/benchmarks_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ func TestCityLots(t *testing.T) {
126126
message1 := fmt.Sprintf("Events-per-second benchmark ran at %.0f events per second, below threshold of %.0f.",
127127
perSecond, thresholdPerformance)
128128
message2 := `
129-
It may be that re-running the benchmark test will address this, or it may be that you're running on a machine
130-
that is slower than the one the software was developed on, in which case you might want to readjust the
131-
"thresholdPerformance" constant. However, it may be that you made a change that reduced the throughput of the
132-
library, which would be unacceptable.`
129+
It may be that re-running the benchmark test will address this, or it may be that you're running on a machine
130+
that is slower than the one the software was developed on, in which case you might want to readjust the
131+
"thresholdPerformance" constant. However, it may be that you made a change that reduced the throughput of the
132+
library, which would be unacceptable.`
133133
t.Errorf(message1 + message2)
134134
}
135135

lib/small_table.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,11 @@ func newSmallTable[S comparable]() *smallTable[S] {
7070
}
7171
}
7272

73+
// step finds the step in the smallTable that corresponds to the utf8Byte argument. It may return nil.
7374
func (t *smallTable[S]) step(utf8Byte byte) S {
74-
// In a genericized context you can't just throw around "nil" you declare a variable and
75-
// Go will ensure it has the zero value, i.e. nil
76-
var nilS S
7775
for index, ceiling := range t.slices.ceilings {
7876
if utf8Byte < ceiling {
79-
if t.slices.steps[index] == nilS {
80-
return nilS
81-
} else {
82-
return t.slices.steps[index]
83-
}
77+
return t.slices.steps[index]
8478
}
8579
}
8680
panic("Malformed smallTable")

0 commit comments

Comments
 (0)