Minor cleanup.

PiperOrigin-RevId: 392982022
This commit is contained in:
Galen Andrew 2021-08-25 14:34:23 -07:00 committed by A. Unique TensorFlower
parent 433b66b316
commit 9b48c81b6a

View file

@ -62,14 +62,14 @@ class DpEventBuilder(object):
"""Builds and returns the composed DpEvent represented by the builder."""
if not self._composed_event:
self_composed_events = []
for event, num_self_compositions in self._events.items():
if num_self_compositions == 1:
for event, count in self._events.items():
if count == 1:
self_composed_events.append(event)
else:
self_composed_events.append(
dp_event.SelfComposedDpEvent(event, num_self_compositions))
dp_event.SelfComposedDpEvent(event, count))
if not self_composed_events:
return dp_event.NoOpDpEvent()
self._composed_event = dp_event.NoOpDpEvent()
elif len(self_composed_events) == 1:
self._composed_event = self_composed_events[0]
else: