diff options
author | 2002-02-21 17:36:12 +0000 | |
---|---|---|
committer | 2002-02-21 17:36:12 +0000 | |
commit | a01a3124f26ce10f5a8775f2e51315efb766392c (patch) | |
tree | 48ec37aa03bb93e57d7159dca0cb4800268ba351 | |
parent | fgsch, if you commit without test compiling ONE MORE TIME, I will send a castration team down to argentina (diff) | |
download | wireguard-openbsd-a01a3124f26ce10f5a8775f2e51315efb766392c.tar.xz wireguard-openbsd-a01a3124f26ce10f5a8775f2e51315efb766392c.zip |
"rephrase" the loop's condition, gets rid of an ugly operation.
-rw-r--r-- | usr.bin/mg/undo.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/mg/undo.c b/usr.bin/mg/undo.c index 2dbe5a5dbc3..8617b698d3d 100644 --- a/usr.bin/mg/undo.c +++ b/usr.bin/mg/undo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: undo.c,v 1.5 2002/02/21 04:21:05 vincent Exp $ */ +/* $OpenBSD: undo.c,v 1.6 2002/02/21 17:36:12 vincent Exp $ */ /* * Copyright (c) 2002 Vincent Labrecque <vincent@openbsd.org> * All rights reserved. @@ -254,6 +254,7 @@ undo_add_insert(LINE *lp, int offset, int size) return TRUE; } } + /* * We couldn't reuse the last undo record, so prepare a new one */ @@ -407,7 +408,7 @@ undo(int f, int n) */ undoaction++; - while (n-- > 0) { + while (n > 0) { rec = LIST_FIRST(&undo_list); if (rec == NULL) { ewprintf("Nothing to undo!"); @@ -418,7 +419,6 @@ undo(int f, int n) LIST_REMOVE(rec, next); if (rec->type == BOUNDARY) { - n++; /* XXX */ continue; } @@ -448,6 +448,8 @@ undo(int f, int n) } free_undo_record(rec); + + n--; } undoaction--; |