Simplify number input checking
This commit is contained in:
parent
f0db407f4d
commit
4295ed85de
1 changed files with 0 additions and 4 deletions
4
main.cpp
4
main.cpp
|
@ -135,10 +135,6 @@ count_type get_number(string prompt) {
|
||||||
ch = getch();
|
ch = getch();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if input is a number
|
|
||||||
for(int i = 0; i < s.size(); i++)
|
|
||||||
if(s[i] < '0' || s[i] > '9')
|
|
||||||
return file_offset + cur.r;
|
|
||||||
if(s.size() == 0)
|
if(s.size() == 0)
|
||||||
return file_offset + cur.r;
|
return file_offset + cur.r;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue