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

Bad Code #306

Closed
elibroftw opened this issue Jan 17, 2022 · 0 comments
Closed

Bad Code #306

elibroftw opened this issue Jan 17, 2022 · 0 comments

Comments

@elibroftw
Copy link

operations = {o: ops.index(o) for o in ops}

Use enumerate instead.

def getOperationNameForId(i):

This is also unoptimized. It is as simple as

def get_operation_name(i: int):
    if i < len(ops):
        return ops[i]
    return f'Unknown Operation ID {i}'
xeroc added a commit that referenced this issue May 13, 2022
@xeroc xeroc closed this as completed May 13, 2022
xeroc added a commit that referenced this issue May 13, 2022
This reverts commit 3b38b99.
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

No branches or pull requests

2 participants