Descent098 / ahd

Unnecessary use of comprehension PYL-R1721
Performance
Major
2 years ago2 years old
Unnecessary use of a comprehension, use list(config['macros']) instead.
303        if not config.get("macros", False):
304            print(f"{colored.fg(1)}No macros found in current config {colored.fg(15)}\n")
305            sys.exit(1)
306        commands = [current_command for current_command in config["macros"]] # Get list of commands in config307        error_threshold = 60 # The percentage of likelyhood before similar words will throw out result
308        similar_words = suggest_word.extractBests(name, commands,score_cutoff=error_threshold , limit=3) # Generate word sugestions
309        if not similar_words: # If there are not similar commands that exist in the config