save one readline
@@ -108,8 +108,8 @@ def read_buffer(f):
elif environ == 'PhysicalNames':
line = f.readline().decode('utf-8')
num_phys_names = int(line)
- for k, line in enumerate(islice(f, num_phys_names)):
- line = line.decode('utf-8')
+ for k in range(num_phys_names):
+ line = f.readline().decode('utf-8')
key = line.split(' ')[2].replace('"', '').replace('\n', '')
phys_group = int(line.split(' ')[1])
field_data[key] = phys_group
