Declare garray iterators in the for() scope where possible #819

This commit is contained in:
Felipe Oliveira Carvalho
2014-06-06 23:25:13 -03:00
committed by Justin M. Keyes
parent a321480342
commit f39fd5b4c4
16 changed files with 232 additions and 324 deletions

View File

@@ -3153,12 +3153,11 @@ char_u *get_users(expand_T *xp, int idx)
*/
int match_user(char_u *name)
{
int i;
int n = (int)STRLEN(name);
int result = 0;
init_users();
for (i = 0; i < ga_users.ga_len; i++) {
for (int i = 0; i < ga_users.ga_len; i++) {
if (STRCMP(((char_u **)ga_users.ga_data)[i], name) == 0)
return 2; /* full match */
if (STRNCMP(((char_u **)ga_users.ga_data)[i], name, n) == 0)