diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-07-13 16:31:19 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-07-13 16:31:19 +0200 |
commit | efc81331e7bceafa2d7bc452a98d6ec1943b4292 (patch) | |
tree | 8942668ba3f82569214a27cd0acf5ccabd565a4d /src/undo.c | |
parent | e76c4b237d41d0e62ca5d4fc76d1dd163fe222c0 (diff) | |
download | vim-git-efc81331e7bceafa2d7bc452a98d6ec1943b4292.tar.gz |
patch 8.1.0179: redundant condition for boundary checkv8.1.0179
Problem: Redundant condition for boundary check.
Solution: Remove the condition. (Dominique Pelle). Change FALSE to FAIL.
Diffstat (limited to 'src/undo.c')
-rw-r--r-- | src/undo.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/undo.c b/src/undo.c index b3a627686..040ec5480 100644 --- a/src/undo.c +++ b/src/undo.c @@ -266,10 +266,8 @@ u_save(linenr_T top, linenr_T bot) if (undo_off) return OK; - if (top > curbuf->b_ml.ml_line_count - || top >= bot - || bot > curbuf->b_ml.ml_line_count + 1) - return FALSE; /* rely on caller to do error messages */ + if (top >= bot || bot > curbuf->b_ml.ml_line_count + 1) + return FAIL; // rely on caller to give an error message if (top + 2 == bot) u_saveline((linenr_T)(top + 1)); |