mirror of
https://github.com/neovim/neovim.git
synced 2025-10-06 01:46:29 +00:00
refactor: follow style guide
- reduce variable scope - prefer initialization over declaration and assignment
This commit is contained in:
@@ -2938,11 +2938,10 @@ void f_trim(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
}
|
||||
}
|
||||
|
||||
int c1;
|
||||
if (dir == 0 || dir == 1) {
|
||||
// Trim leading characters
|
||||
while (*head != NUL) {
|
||||
c1 = utf_ptr2char(head);
|
||||
int c1 = utf_ptr2char(head);
|
||||
if (mask == NULL) {
|
||||
if (c1 > ' ' && c1 != 0xa0) {
|
||||
break;
|
||||
@@ -2967,7 +2966,7 @@ void f_trim(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
for (; tail > head; tail = prev) {
|
||||
prev = tail;
|
||||
MB_PTR_BACK(head, prev);
|
||||
c1 = utf_ptr2char(prev);
|
||||
int c1 = utf_ptr2char(prev);
|
||||
if (mask == NULL) {
|
||||
if (c1 > ' ' && c1 != 0xa0) {
|
||||
break;
|
||||
|
Reference in New Issue
Block a user