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

add_api_operation refactor #952

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shimakaze-git
Copy link

@shimakaze-git shimakaze-git commented Nov 23, 2023

Hello,

I've refactored the conditional logic in the add_api_operation method of the Router class for improved readability. The new approach uses the dictionary's get method, which simplifies the code.

Here's the updated code snippet:

path_view: Optional[PathView] = self.path_operations.get(path)
if not path_view:
    path_view = PathView()
    self.path_operations[path] = path_view

Thank you for considering this change.

@shimakaze-git shimakaze-git changed the title refactor: if refactor [WIP] refactor: if refactor Nov 23, 2023
@shimakaze-git shimakaze-git changed the title [WIP] refactor: if refactor add_api_operation refactor Nov 23, 2023
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.

None yet

1 participant