File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed
Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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.
7374func (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" )
You can’t perform that action at this time.
0 commit comments