Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Origination operation type, fix processing multiple indexes #41

Merged
merged 9 commits into from
May 6, 2021

Conversation

droserasprout
Copy link
Member

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.

2 participants