From 0f3a6b4b20839dc0a52d323b73804abf1b209164 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Schaerer?= Date: Wed, 21 Jul 2010 16:48:35 +0200 Subject: [PATCH] avoid doing the cleanup every time --- autojump | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autojump b/autojump index 6338ab9..fb75b9f 100755 --- a/autojump +++ b/autojump @@ -22,7 +22,7 @@ from sys import argv,exit,stderr import os import signal max_keyweight=1000 -max_stored_paths=300 +max_stored_paths=400 completion_separator='__' def signal_handler(arg1,arg2): @@ -62,7 +62,8 @@ def forget(path_dict,dic_file): def clean_dict(sorted_dirs,path_dict): """Limits the sized of the path_dict to max_stored_paths. Returns True if keys were deleted""" if len(sorted_dirs) > max_stored_paths: - for dir,dummy in sorted_dirs[max_stored_paths:]: + #remove 25 more than needed, to avoid doing it every time + for dir,dummy in sorted_dirs[max_stored_paths-25:]: del path_dict[dir] return True else: return False