Core: use patch extension register directly (#4375)

Co-authored-by: Aaron Wagener <mmmcheese158@gmail.com>
This commit is contained in:
qwint
2025-07-26 15:13:15 -05:00
committed by GitHub
parent faac2540bf
commit fa49fef695

View File

@@ -15,7 +15,6 @@ import bsdiff4
semaphore = threading.Semaphore(os.cpu_count() or 4)
del threading
del os
class AutoPatchRegister(abc.ABCMeta):
@@ -34,10 +33,8 @@ class AutoPatchRegister(abc.ABCMeta):
@staticmethod
def get_handler(file: str) -> Optional[AutoPatchRegister]:
for file_ending, handler in AutoPatchRegister.file_endings.items():
if file.endswith(file_ending):
return handler
return None
_, suffix = os.path.splitext(file)
return AutoPatchRegister.file_endings.get(suffix, None)
class AutoPatchExtensionRegister(abc.ABCMeta):