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

chore: use inline #438

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions a_sync/a_sync/_flags.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ from a_sync import exceptions
from a_sync.a_sync.flags import AFFIRMATIVE_FLAGS, NEGATIVE_FLAGS


cdef bint negate_if_necessary(str flag, bint flag_value):
cdef inline bint negate_if_necessary(str flag, bint flag_value):
"""Negate the flag value if necessary based on the flag type.

This function checks if the provided flag is in the set of affirmative or negative flags
Expand Down Expand Up @@ -51,7 +51,7 @@ cdef bint negate_if_necessary(str flag, bint flag_value):
raise exceptions.InvalidFlag(flag)


cdef bint validate_flag_value(str flag, object flag_value):
cdef inline bint validate_flag_value(str flag, object flag_value):
"""
Validate that the flag value is a boolean.

Expand Down
6 changes: 3 additions & 3 deletions a_sync/a_sync/_kwargs.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def get_flag_name_legacy(dict kwargs) -> str:
return get_flag_name(kwargs)


cdef str get_flag_name(dict kwargs):
cdef inline str get_flag_name(dict kwargs):
"""
Get the name of the flag present in the kwargs.

Expand Down Expand Up @@ -46,7 +46,7 @@ cdef str get_flag_name(dict kwargs):
raise exceptions.TooManyFlags("kwargs", present_flags)


cdef bint is_sync(str flag, dict kwargs, bint pop_flag):
cdef inline bint is_sync(str flag, dict kwargs, bint pop_flag):
"""
Determine if the operation should be synchronous based on the flag value.

Expand All @@ -66,4 +66,4 @@ cdef bint is_sync(str flag, dict kwargs, bint pop_flag):
try:
return negate_if_necessary(flag, kwargs[flag])
except TypeError as e:
raise exceptions.InvalidFlagValue(flag, kwargs[flag]) from e.__cause__
raise exceptions.InvalidFlagValue(flag, kwargs[flag]) from e.__cause__
Loading