make dict comprehension more readable

This commit is contained in:
Maximilian Hils 2019-09-05 22:13:49 +02:00 committed by GitHub
parent 4ce5e1386c
commit e97a804e89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,7 +87,10 @@ def response(flow):
}
# HAR timings are integers in ms, so we re-encode the raw timings to that format.
timings = dict([(k, -1 if v is -1 else int(1000 * v)) for k, v in timings_raw.items()])
timings = {
k: int(1000 * v) if v != -1 else -1
for k, v in timings_raw.items()
}
# full_time is the sum of all timings.
# Timings set to -1 will be ignored as per spec.