@@ -208,14 +208,14 @@ func testDeltaVerifyResult(t *testing.T, name string, expected map[uint64]uint64
208208}
209209
210210func BenchmarkDelta (b * testing.B ) {
211- for n := 1 << 10 ; n <= 1 << 20 ; n <<= 1 {
212- b .Run (strconv .Itoa ( n ), func (b * testing.B ) {
211+ for n := uint64 ( 1 << 10 ) ; n <= 1 << 20 ; n <<= 1 {
212+ b .Run (strconv .FormatUint ( n , 10 ), func (b * testing.B ) {
213213 benchmarkDelta (b , n )
214214 })
215215 }
216216}
217217
218- func benchmarkDelta (b * testing.B , numEntities int ) {
218+ func benchmarkDelta (b * testing.B , numEntities uint64 ) {
219219 chActual := make ([]chan database.Entity , b .N )
220220 chDesired := make ([]chan database.Entity , b .N )
221221 for i := 0 ; i < b .N ; i ++ {
@@ -231,20 +231,20 @@ func benchmarkDelta(b *testing.B, numEntities int) {
231231 binary .BigEndian .PutUint64 (e .PropertiesChecksum , checksum )
232232 return e
233233 }
234- for i := 0 ; i < numEntities ; i ++ {
234+ for i := uint64 ( 0 ) ; i < numEntities ; i ++ {
235235 // each iteration writes exactly one entity to each channel
236236 var eActual , eDesired database.Entity
237237 switch i % 3 {
238238 case 0 : // distinct IDs
239- eActual = makeEndpoint (1 , uint64 ( i ), uint64 ( i ) )
240- eDesired = makeEndpoint (2 , uint64 ( i ), uint64 ( i ) )
239+ eActual = makeEndpoint (1 , i , i )
240+ eDesired = makeEndpoint (2 , i , i )
241241 case 1 : // same ID, same checksum
242- e := makeEndpoint (3 , uint64 ( i ), uint64 ( i ) )
242+ e := makeEndpoint (3 , i , i )
243243 eActual = e
244244 eDesired = e
245245 case 2 : // same ID, different checksum
246- eActual = makeEndpoint (4 , uint64 ( i ), uint64 ( i ) )
247- eDesired = makeEndpoint (4 , uint64 ( i ), uint64 ( i + 1 ) )
246+ eActual = makeEndpoint (4 , i , i )
247+ eDesired = makeEndpoint (4 , i , i + 1 )
248248 }
249249 for _ , ch := range chActual {
250250 ch <- eActual
0 commit comments