1
0
mirror of https://github.com/lancedikson/bowser synced 2024-10-27 20:34:22 +00:00

Fix no-else-return issue

This commit is contained in:
Denis Demchenko 2018-09-09 13:52:41 +03:00
parent 7e10b20aba
commit c04942947e

View File

@ -110,15 +110,18 @@ class Utils {
// 4) compare: "000000009" > "000000010" = false (but "9" > "10" = true)
if (chunks[0][precision] > chunks[1][precision]) {
return 1;
} else if (chunks[0][precision] === chunks[1][precision]) {
}
if (chunks[0][precision] === chunks[1][precision]) {
if (precision === lastPrecision) {
// all version chunks are same
return 0;
}
} else {
precision -= 1;
} else if (chunks[0][precision] < chunks[1][precision]) {
return -1;
}
precision -= 1;
}
}