Fix the loop of validLanguage iterating too much.
This commit is contained in:
parent
75fd1d93d4
commit
697af646d3
|
@ -8,7 +8,7 @@ pair<LANGUAGE, bool> validLanguage(const string& it) {
|
||||||
static const string_view languages[3] = {".lua", ".js", ".py"};
|
static const string_view languages[3] = {".lua", ".js", ".py"};
|
||||||
LANGUAGE selected = LUA;
|
LANGUAGE selected = LUA;
|
||||||
bool valid = false;
|
bool valid = false;
|
||||||
for (unsigned short i = 0; (i < languages->size()); ++i) {
|
for (unsigned short i = 0; (i <= (languages->size() - 2)); ++i) {
|
||||||
if (it == languages[i]) {
|
if (it == languages[i]) {
|
||||||
selected = static_cast<LANGUAGE>(i);
|
selected = static_cast<LANGUAGE>(i);
|
||||||
valid = true;
|
valid = true;
|
||||||
|
|
Loading…
Reference in New Issue