diff --git a/src/fuzz_introspector/datatypes/project_profile.py b/src/fuzz_introspector/datatypes/project_profile.py index 64e529fe5..462ada6cb 100644 --- a/src/fuzz_introspector/datatypes/project_profile.py +++ b/src/fuzz_introspector/datatypes/project_profile.py @@ -144,7 +144,8 @@ def __init__(self, profiles: List[fuzzer_profile.FuzzerProfile], # Add all functions from the various profiles into the merged profile. Don't # add duplicates logger.info("Creating all_functions dictionary") - excluded_functions = {"sanitizer", "llvm", "LLVMFuzzerTestOneInput"} + # Performance Optimization: Using a tuple for string checks is faster. + excluded_functions = ("sanitizer", "llvm", "LLVMFuzzerTestOneInput") for profile in profiles: # Handles jvm constructors for fd in profile.all_class_constructors.values(): @@ -159,8 +160,12 @@ def __init__(self, profiles: List[fuzzer_profile.FuzzerProfile], # Handles normal functions for fd in profile.all_class_functions.values(): # continue if the function is to be excluded - if any(to_exclude in fd.function_name - for to_exclude in excluded_functions): + is_excluded = False + for to_exclude in excluded_functions: + if to_exclude in fd.function_name: + is_excluded = True + break + if is_excluded: continue current_fd = self.all_functions.get(fd.function_name)