Skip to content

Conversation

@droserasprout
Copy link
Collaborator

No description provided.

@droserasprout droserasprout marked this pull request as ready for review May 5, 2021 10:39
self._operations: Dict[int, List[Dict[str, Any]]] = {}

def _get_head(self, operations: List[Dict[str, Any]]):
for i in range(len(operations) - 1)[::-1]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for i in range(len(operations) - 1, 0, -1) should be faster, no?

for i in range(len(operations) - 1)[::-1]:
if operations[i]['level'] != operations[i + 1]['level']:
return operations[i]['level']
return operations[0]['level']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only if this is a final chunk (len(operations) < 10000)

@droserasprout droserasprout merged commit ead7c6b into master May 6, 2021
@droserasprout droserasprout deleted the feat/origination-pattern branch May 6, 2021 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants