Skip to content

Commit

Permalink
Move an idempotent loop out of another loop in serialization
Browse files Browse the repository at this point in the history
This inner loop populates a table of data serializers, which should happen
at the same level as populating the table of code serializers, rather than
as an inner loop of code serializer population.

This inner loop is idempotent, so the behaviour should mostly be unchanged
by this PR, but in the obscure situation that someone modifies serialisation
so that it has no code serializers, only data serializers, then before this
PR, I think those data serializers would not be visible to users, as the
inner loop would never be executed.

This was introduced by PR #2467 which moved away from using a class singleton
to using the module as the singleton.
  • Loading branch information
benclifford committed May 19, 2023
1 parent 2d952f1 commit 82bdbba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions parsl/serialize/facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
methods_for_code[key] = METHODS_MAP_CODE[key]()
methods_for_code[key].enable_caching(maxsize=128)

for key in METHODS_MAP_DATA:
methods_for_data[key] = METHODS_MAP_DATA[key]()
for key in METHODS_MAP_DATA:
methods_for_data[key] = METHODS_MAP_DATA[key]()


def _list_methods() -> Tuple[Dict[bytes, SerializerBase], Dict[bytes, SerializerBase]]:
Expand Down

0 comments on commit 82bdbba

Please sign in to comment.