Page MenuHomeSoftware Heritage

Explicitely implement from_dict instead of using introspection magic.
ClosedPublic

Authored by vlorentz on May 9 2019, 4:30 PM.

Details

Summary

There is more repetition, but it's easier to read and
'%timeit Revision.from_dict(d)' is 5 times faster.

Diff Detail

Repository
rDMOD Data model
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

douardda added a subscriber: douardda.

I agree it's easier to read, so LGTM (just a small refactoring and I'm ok with this)

swh/model/model.py
310

should be the right time to rewrite this using a list comprehension IMHO

This revision now requires changes to proceed.May 10 2019, 10:23 AM
This revision is now accepted and ready to land.May 10 2019, 10:26 AM
This revision was automatically updated to reflect the committed changes.