diff options
author | Vincent Labrecque <vincent@cvs.openbsd.org> | 2004-07-14 02:33:41 +0000 |
---|---|---|
committer | Vincent Labrecque <vincent@cvs.openbsd.org> | 2004-07-14 02:33:41 +0000 |
commit | 1020ba6a8b0aabd59901777a5c74a1d1b5889364 (patch) | |
tree | d79d42ff59a7d1edc15a0920154fd8e95e4418aa /usr.bin | |
parent | 5c07516451e9563ce52fcb76a682312deb44334e (diff) |
microoptimization!
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cvs/rcs.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/usr.bin/cvs/rcs.c b/usr.bin/cvs/rcs.c index 20ded61cde4..8be1ade9e19 100644 --- a/usr.bin/cvs/rcs.c +++ b/usr.bin/cvs/rcs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcs.c,v 1.1 2004/07/13 22:02:40 jfb Exp $ */ +/* $OpenBSD: rcs.c,v 1.2 2004/07/14 02:33:40 vincent Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -487,16 +487,12 @@ rcs_patch(const char *data, const char *patch) } /* once we're done patching, rebuild the line numbers */ - lineno = 1; + lineno = 0; TAILQ_FOREACH(lp, &(dlines->rl_lines), rl_list) { - if (lineno == 1) { - lineno++; - continue; - } - cvs_buf_fappend(res, "%s\n", lp->rl_line); + if (lineno != 0) + cvs_buf_fappend(res, "%s\n", lp->rl_line); lp->rl_lineno = lineno++; } - dlines->rl_nblines = lineno - 1; return (res); |