diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2023-01-12 12:33:30 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-01-12 12:33:30 +0000 |
commit | 0233bdfa2b487c392dc4fd1a29113e08fbace334 (patch) | |
tree | 83551e09979e7baa762cd11a65ddff2153883e4e /src/indent.c | |
parent | 043d7b2c84cda275354aa023b5769660ea70a168 (diff) |
patch 9.0.1183: code is indented more than necessaryv9.0.1183
Problem: Code is indented more than necessary.
Solution: Use an early return where it makes sense. (Yegappan Lakshmanan,
closes #11805)
Diffstat (limited to 'src/indent.c')
-rw-r--r-- | src/indent.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/indent.c b/src/indent.c index cbb3f94f4b..477a44deb1 100644 --- a/src/indent.c +++ b/src/indent.c @@ -2188,12 +2188,12 @@ fixthisline(int (*get_the_indent)(void)) { int amount = get_the_indent(); - if (amount >= 0) - { - change_indent(INDENT_SET, amount, FALSE, 0, TRUE); - if (linewhite(curwin->w_cursor.lnum)) - did_ai = TRUE; // delete the indent if the line stays empty - } + if (amount < 0) + return; + + change_indent(INDENT_SET, amount, FALSE, 0, TRUE); + if (linewhite(curwin->w_cursor.lnum)) + did_ai = TRUE; // delete the indent if the line stays empty } /* |