Browse Source

Use explicit else for array/map selection

This is a simple if/else logic so I agree an explicit else clause
is appropriate.
Raul Silvera 8 years ago
parent
commit
79372344b4
1 changed files with 10 additions and 10 deletions
  1. 10
    10
      profile/encode.go

+ 10
- 10
profile/encode.go View File

237
 		m.BuildID, err = getString(p.stringTable, &m.buildIDX, err)
237
 		m.BuildID, err = getString(p.stringTable, &m.buildIDX, err)
238
 		if m.ID < uint64(len(mappingIds)) {
238
 		if m.ID < uint64(len(mappingIds)) {
239
 			mappingIds[m.ID] = m
239
 			mappingIds[m.ID] = m
240
-			continue
240
+		} else {
241
+			mappings[m.ID] = m
241
 		}
242
 		}
242
-		mappings[m.ID] = m
243
 	}
243
 	}
244
 
244
 
245
 	functions := make(map[uint64]*Function, len(p.Function))
245
 	functions := make(map[uint64]*Function, len(p.Function))
250
 		f.Filename, err = getString(p.stringTable, &f.filenameX, err)
250
 		f.Filename, err = getString(p.stringTable, &f.filenameX, err)
251
 		if f.ID < uint64(len(functionIds)) {
251
 		if f.ID < uint64(len(functionIds)) {
252
 			functionIds[f.ID] = f
252
 			functionIds[f.ID] = f
253
-			continue
253
+		} else {
254
+			functions[f.ID] = f
254
 		}
255
 		}
255
-		functions[f.ID] = f
256
 	}
256
 	}
257
 
257
 
258
 	locations := make(map[uint64]*Location, len(p.Location))
258
 	locations := make(map[uint64]*Location, len(p.Location))
269
 				l.Line[i].functionIDX = 0
269
 				l.Line[i].functionIDX = 0
270
 				if id < uint64(len(functionIds)) {
270
 				if id < uint64(len(functionIds)) {
271
 					l.Line[i].Function = functionIds[id]
271
 					l.Line[i].Function = functionIds[id]
272
-					continue
272
+				} else {
273
+					l.Line[i].Function = functions[id]
273
 				}
274
 				}
274
-				l.Line[i].Function = functions[id]
275
 			}
275
 			}
276
 		}
276
 		}
277
 		if l.ID < uint64(len(locationIds)) {
277
 		if l.ID < uint64(len(locationIds)) {
278
 			locationIds[l.ID] = l
278
 			locationIds[l.ID] = l
279
-			continue
279
+		} else {
280
+			locations[l.ID] = l
280
 		}
281
 		}
281
-		locations[l.ID] = l
282
 	}
282
 	}
283
 
283
 
284
 	for _, st := range p.SampleType {
284
 	for _, st := range p.SampleType {
309
 		for i, lid := range s.locationIDX {
309
 		for i, lid := range s.locationIDX {
310
 			if lid < uint64(len(locationIds)) {
310
 			if lid < uint64(len(locationIds)) {
311
 				s.Location[i] = locationIds[lid]
311
 				s.Location[i] = locationIds[lid]
312
-				continue
312
+			} else {
313
+				s.Location[i] = locations[lid]
313
 			}
314
 			}
314
-			s.Location[i] = locations[lid]
315
 		}
315
 		}
316
 		s.locationIDX = nil
316
 		s.locationIDX = nil
317
 	}
317
 	}