Skip to content

Commit 5786572

Browse files
isatsambabenek
andauthored
Use .startswith() to check magic
Co-authored-by: Roman Babenko <babenek@users.noreply.github.com>
1 parent 7f305dd commit 5786572

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

filetype/types/image.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,4 @@ def __init__(self):
418418
)
419419

420420
def match(self, buf):
421-
return (len(buf) > 4 and
422-
buf[0] == 0x44 and
423-
buf[1] == 0x44 and
424-
buf[2] == 0x53 and
425-
buf[3] == 0x20)
421+
return buf.startswith(b'\x44\x44\x53\x20')

0 commit comments

Comments
 (0)