Correct the loop logic for language buttons

It is possible that the count reach more than  SUGGESTED_LANGUAGES_NUMBER
before it reach the

languagesForButtons.length === SUGGESTED_LANGUAGES_NUMBER

check. This will cause the loop to run for all languages.

Change-Id: Ie6190d1c80c2a7152af490db2bc115ecdfde4184
This commit is contained in:
Santhosh Thottingal
2013-06-06 11:56:43 +05:30
committed by Santhosh
parent f16c42ef71
commit c9aa1f1130
2 changed files with 2 additions and 2 deletions

View File

@@ -252,7 +252,7 @@
languagesForButtons.push( suggestedLanguages[lang] );
// No need to add more languages than buttons
if ( languagesForButtons.length === SUGGESTED_LANGUAGES_NUMBER ) {
if ( languagesForButtons.length >= SUGGESTED_LANGUAGES_NUMBER ) {
break;
}
}