Skip to content

Commit 3b5783a

Browse files
committed
Clean up unnessary if statements and redundant function call
1 parent d09312b commit 3b5783a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

marshmallow_dataclass/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,7 @@ def dataclass(
229229
)
230230

231231
def decorator(cls: Type[_U], stacklevel: int = 1) -> Type[_U]:
232-
if cls is not None:
233-
_check_decorated_type(cls)
232+
_check_decorated_type(cls)
234233

235234
return add_schema(
236235
dc(cls), base_schema, cls_frame=cls_frame, stacklevel=stacklevel + 1
@@ -239,8 +238,6 @@ def decorator(cls: Type[_U], stacklevel: int = 1) -> Type[_U]:
239238
if _cls is None:
240239
return decorator
241240

242-
if _cls is not None:
243-
_check_decorated_type(_cls)
244241
return decorator(_cls, stacklevel=stacklevel + 1)
245242

246243

0 commit comments

Comments
 (0)