From 07ac09c0bd2c96dd25a4925e5a9e97fbf2e7fe48 Mon Sep 17 00:00:00 2001 From: Christian Fredrik Johnsen Date: Tue, 5 Nov 2024 19:25:11 +0100 Subject: [PATCH] refactor: convert to if-else one-liner --- main.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/main.py b/main.py index d6f5467..4685b01 100644 --- a/main.py +++ b/main.py @@ -89,10 +89,7 @@ def main(args): neat = load_neat(neat_name) if neat is not None: # TODO: Add option to insert new config into NEAT object. generation_nums, best_fitnesses, avg_fitnesses, min_fitnesses = read_fitness_file(neat_name) - if len(generation_nums) == 0: - from_generation = 0 - else: - from_generation = generation_nums[-1] + 1 + from_generation = generation_nums[-1] + 1 if generation_nums else 0 neat.config = config_instance else: neat = NEAT(config_instance)