Simplify loops

pull/10161/head
Edd Robinson 2018-08-05 15:16:33 +01:00
parent 3f49ab190e
commit 9eece563b1
4 changed files with 5 additions and 5 deletions

View File

@ -523,7 +523,7 @@ func TestBufferedPointsWriter(t *testing.T) {
reset() reset()
// Test writing points one at a time. // Test writing points one at a time.
for i, _ := range r.Points { for i := range r.Points {
if err := w.WritePointsInto(&coordinator.IntoWriteRequest{ if err := w.WritePointsInto(&coordinator.IntoWriteRequest{
Database: db, Database: db,
RetentionPolicy: rp, RetentionPolicy: rp,

View File

@ -871,7 +871,7 @@ func (data *Data) importOneDB(other Data, backupDBName, restoreDBName, backupRPN
for j, sgImport := range rpImport.ShardGroups { for j, sgImport := range rpImport.ShardGroups {
data.MaxShardGroupID++ data.MaxShardGroupID++
rpImport.ShardGroups[j].ID = data.MaxShardGroupID rpImport.ShardGroups[j].ID = data.MaxShardGroupID
for k, _ := range sgImport.Shards { for k := range sgImport.Shards {
data.MaxShardID++ data.MaxShardID++
shardIDMap[sgImport.Shards[k].ID] = data.MaxShardID shardIDMap[sgImport.Shards[k].ID] = data.MaxShardID
sgImport.Shards[k].ID = data.MaxShardID sgImport.Shards[k].ID = data.MaxShardID

View File

@ -394,14 +394,14 @@ func TestEngine_Export(t *testing.T) {
} }
// TEST 1: did we get any extra files not found in the store? // TEST 1: did we get any extra files not found in the store?
for k, _ := range fileData { for k := range fileData {
if _, ok := fileNames[k]; !ok { if _, ok := fileNames[k]; !ok {
t.Errorf("exported a file not in the store: %s", k) t.Errorf("exported a file not in the store: %s", k)
} }
} }
// TEST 2: did we miss any files that the store had? // TEST 2: did we miss any files that the store had?
for k, _ := range fileNames { for k := range fileNames {
if _, ok := fileData[k]; !ok { if _, ok := fileData[k]; !ok {
t.Errorf("failed to export a file from the store: %s", k) t.Errorf("failed to export a file from the store: %s", k)
} }

View File

@ -930,7 +930,7 @@ func (s *Store) Databases() []string {
defer s.mu.RUnlock() defer s.mu.RUnlock()
databases := make([]string, 0, len(s.databases)) databases := make([]string, 0, len(s.databases))
for k, _ := range s.databases { for k := range s.databases {
databases = append(databases, k) databases = append(databases, k)
} }
return databases return databases