Merge "Use len instead of for-loop to get the end index"

This commit is contained in:
Jenkins 2014-02-26 12:46:32 +00:00 committed by Gerrit Code Review
commit 41ddaba58d
1 changed files with 1 additions and 2 deletions

View File

@ -109,8 +109,7 @@ class TSMBackupSimulator:
ret_msg += ('Total number of objects deleted: 1\n'
'Total number of objects failed: 0')
retcode = 0
for idx, backup in enumerate(self._backup_list[path]):
index = idx
index = len(self._backup_list[path]) - 1
del self._backup_list[path][index]
if not len(self._backup_list[path]):
del self._backup_list[path]