Mercurial > vim
comparison src/if_ruby.c @ 16162:cd5c83115ec6 v8.1.1086
patch 8.1.1086: too many curly braces
commit https://github.com/vim/vim/commit/abab0b0fdd6535969447b03a4fffc1947918cf6c
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 30 18:47:01 2019 +0100
patch 8.1.1086: too many curly braces
Problem: Too many curly braces.
Solution: Remove curly braces where they are not needed. (Hirohito Higashi,
closes #3982)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 30 Mar 2019 19:00:07 +0100 |
parents | 518f44125207 |
children | 366978ec2c03 |
comparison
equal
deleted
inserted
replaced
16161:75fa84e2461b | 16162:cd5c83115ec6 |
---|---|
844 if (isnum == 0) | 844 if (isnum == 0) |
845 { | 845 { |
846 enc = rb_enc_find((char *)sval); | 846 enc = rb_enc_find((char *)sval); |
847 vim_free(sval); | 847 vim_free(sval); |
848 if (enc) | 848 if (enc) |
849 { | |
850 return rb_enc_str_new(s, (long)strlen(s), enc); | 849 return rb_enc_str_new(s, (long)strlen(s), enc); |
851 } | |
852 } | 850 } |
853 #endif | 851 #endif |
854 return rb_str_new2(s); | 852 return rb_str_new2(s); |
855 } | 853 } |
856 | 854 |
1169 result = rb_ary_new(); | 1167 result = rb_ary_new(); |
1170 | 1168 |
1171 if (list != NULL) | 1169 if (list != NULL) |
1172 { | 1170 { |
1173 for (curr = list->lv_first; curr != NULL; curr = curr->li_next) | 1171 for (curr = list->lv_first; curr != NULL; curr = curr->li_next) |
1174 { | |
1175 rb_ary_push(result, vim_to_ruby(&curr->li_tv)); | 1172 rb_ary_push(result, vim_to_ruby(&curr->li_tv)); |
1176 } | |
1177 } | 1173 } |
1178 } | 1174 } |
1179 else if (tv->v_type == VAR_DICT) | 1175 else if (tv->v_type == VAR_DICT) |
1180 { | 1176 { |
1181 result = rb_hash_new(); | 1177 result = rb_hash_new(); |
1225 typval_T *tv; | 1221 typval_T *tv; |
1226 VALUE result; | 1222 VALUE result; |
1227 | 1223 |
1228 tv = eval_expr((char_u *)StringValuePtr(str), NULL); | 1224 tv = eval_expr((char_u *)StringValuePtr(str), NULL); |
1229 if (tv == NULL) | 1225 if (tv == NULL) |
1230 { | |
1231 return Qnil; | 1226 return Qnil; |
1232 } | |
1233 result = vim_to_ruby(tv); | 1227 result = vim_to_ruby(tv); |
1234 | 1228 |
1235 free_tv(tv); | 1229 free_tv(tv); |
1236 | 1230 |
1237 return result; | 1231 return result; |