Skip to content

Commit 61fbd97

Browse files
author
Ruslan Zavacky
committed
Merge pull request #20 from areggiori/master
Fixed bug when using limit on detect and specifying languageType
2 parents 34a855c + c81c6e6 commit 61fbd97

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

lib/LanguageDetect.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,6 @@ LanguageDetect.prototype = {
213213

214214
if (!scoresLength) return [];
215215

216-
scores = limit > 0 ? scores.slice(0, limit) : scores;
217-
218216
switch (me.languageType) {
219217
case 'iso2':
220218
for (i = scoresLength; i--;) {
@@ -231,4 +229,4 @@ LanguageDetect.prototype = {
231229
// limit the number of returned scores
232230
return limit > 0 ? scores.slice(0, limit) : scores;
233231
}
234-
}
232+
}

0 commit comments

Comments
 (0)