[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] [cvs2svn] Code cleanup - Use "for: ... else: ..." to avoid a temporary variable

From: Max Bowsher <maxb_at_ukf.net>
Date: 2003-08-23 12:43:22 CEST

* tools/cvs2svn/cvs2svn.py (SymbolicNameTracker.bump_rev_count):
    Use "for: ... else: ..." construct to render temporary variable
unnecessary.

Index: cvs2svn.py
===================================================================
--- cvs2svn.py (revision 6839)
+++ cvs2svn.py (working copy)
@@ -1310,20 +1310,17 @@
       entry_val[revlist_key] = [(rev, 1)]
     else:
       rev_counts = entry_val[revlist_key]
- done = None
       for i in range(len(rev_counts)):
         this_rev, this_count = rev_counts[i]
         if rev == this_rev:
           rev_counts[i] = (this_rev, this_count + 1)
- done = 1
           break
         elif this_rev > rev:
           if i > 0:
             i = i - 1
           rev_counts.insert(i, (rev, 1))
- done = 1
           break
- if not done:
+ else:
         rev_counts.append((rev, 1))
       entry_val[revlist_key] = rev_counts

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Aug 23 13:19:12 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.