Skip to content

Commit c361f3a

Browse files
committed
Clean up unnessary if statements and redundant function call
1 parent 8797b2b commit c361f3a

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
@@ -230,8 +230,7 @@ def dataclass(
230230
)
231231

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

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

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

247244

0 commit comments

Comments
 (0)