/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to grep.py

  • Committer: Parth Malwankar
  • Date: 2010-03-15 18:58:36 UTC
  • mto: (0.44.2 grep) (6531.3.1 merge-grep)
  • mto: This revision was merged to the branch mainline in revision 6555.
  • Revision ID: parth.malwankar@gmail.com-20100315185836-4ak5va1k4dd5aqme
core loop uses one less variable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
        pfmt = fmt_rev_n
217
217
        index = 1
218
218
        for line in file_text.split("\n"):
219
 
            res = patternc.search(line)
220
 
            if res:
 
219
            if patternc.search(line):
221
220
                line = line.rstrip()
222
221
                outf.write(pfmt % (revno, index, line))
223
222
            index += 1
226
225
 
227
226
        pfmt = fmt_rev
228
227
        for line in file_text.split("\n"):
229
 
            res = patternc.search(line)
230
 
            if res:
 
228
            if patternc.search(line):
231
229
                line = line.rstrip()
232
230
                outf.write(pfmt % (revno, line))
233
231
 
236
234
        pfmt = fmt_n
237
235
        index = 1
238
236
        for line in file_text.split("\n"):
239
 
            res = patternc.search(line)
240
 
            if res:
 
237
            if patternc.search(line):
241
238
                line = line.rstrip()
242
239
                outf.write(pfmt % (index, line))
243
240
            index += 1
246
243
 
247
244
        pfmt = fmt
248
245
        for line in file_text.split("\n"):
249
 
            res = patternc.search(line)
250
 
            if res:
 
246
            if patternc.search(line):
251
247
                line = line.rstrip()
252
248
                outf.write(pfmt % (line,))
253
249