Simplify loops
parent
3f49ab190e
commit
9eece563b1
|
@ -523,7 +523,7 @@ func TestBufferedPointsWriter(t *testing.T) {
|
|||
reset()
|
||||
|
||||
// Test writing points one at a time.
|
||||
for i, _ := range r.Points {
|
||||
for i := range r.Points {
|
||||
if err := w.WritePointsInto(&coordinator.IntoWriteRequest{
|
||||
Database: db,
|
||||
RetentionPolicy: rp,
|
||||
|
|
|
@ -871,7 +871,7 @@ func (data *Data) importOneDB(other Data, backupDBName, restoreDBName, backupRPN
|
|||
for j, sgImport := range rpImport.ShardGroups {
|
||||
data.MaxShardGroupID++
|
||||
rpImport.ShardGroups[j].ID = data.MaxShardGroupID
|
||||
for k, _ := range sgImport.Shards {
|
||||
for k := range sgImport.Shards {
|
||||
data.MaxShardID++
|
||||
shardIDMap[sgImport.Shards[k].ID] = data.MaxShardID
|
||||
sgImport.Shards[k].ID = data.MaxShardID
|
||||
|
|
|
@ -394,14 +394,14 @@ func TestEngine_Export(t *testing.T) {
|
|||
}
|
||||
|
||||
// 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 {
|
||||
t.Errorf("exported a file not in the store: %s", k)
|
||||
}
|
||||
}
|
||||
|
||||
// TEST 2: did we miss any files that the store had?
|
||||
for k, _ := range fileNames {
|
||||
for k := range fileNames {
|
||||
if _, ok := fileData[k]; !ok {
|
||||
t.Errorf("failed to export a file from the store: %s", k)
|
||||
}
|
||||
|
|
|
@ -930,7 +930,7 @@ func (s *Store) Databases() []string {
|
|||
defer s.mu.RUnlock()
|
||||
|
||||
databases := make([]string, 0, len(s.databases))
|
||||
for k, _ := range s.databases {
|
||||
for k := range s.databases {
|
||||
databases = append(databases, k)
|
||||
}
|
||||
return databases
|
||||
|
|
Loading…
Reference in New Issue