aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2021-01-09 15:36:14 +0900
committererw7 <erw7.github@gmail.com>2021-01-09 15:36:14 +0900
commitcb457f5f7fab4c42b15e7f27313deeb203fcfec6 (patch)
tree97f8fb5bfdedf93d1f6c00d40c08428b7728027f /src
parenteaab8e494d6db6ebe0d745d6c9c55d5ba01e133b (diff)
downloadrneovim-cb457f5f7fab4c42b15e7f27313deeb203fcfec6.tar.gz
rneovim-cb457f5f7fab4c42b15e7f27313deeb203fcfec6.tar.bz2
rneovim-cb457f5f7fab4c42b15e7f27313deeb203fcfec6.zip
buffer.c: remove useless 'for' loops.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/buffer.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c
index 004ef8aa41..76205c70ae 100644
--- a/src/nvim/buffer.c
+++ b/src/nvim/buffer.c
@@ -4482,22 +4482,15 @@ int build_stl_str_hl(
int num_separators = 0;
for (int i = 0; i < itemcnt; i++) {
if (stl_items[i].type == Separate) {
+ // Create an array of the start location for each
+ // separator mark.
+ stl_separator_locations[num_separators] = i;
num_separators++;
}
}
// If we have separated groups, then we deal with it now
if (num_separators) {
- // Create an array of the start location for each
- // separator mark.
- int index = 0;
- for (int i = 0; i < itemcnt; i++) {
- if (stl_items[i].type == Separate) {
- stl_separator_locations[index] = i;
- index++;
- }
- }
-
int standard_spaces = (maxwidth - width) / num_separators;
int final_spaces = (maxwidth - width) -
standard_spaces * (num_separators - 1);