1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-06-06 15:11:35 +00:00

Replacement of empty() method by assertion.

This commit is contained in:
Miroslav Puda 2013-05-22 13:23:49 +02:00
parent 3cebb41459
commit 7149439ace

View file

@ -1,6 +1,7 @@
#include "scanner.hpp" #include "scanner.hpp"
#include <cassert>
#include <cctype> #include <cctype>
#include <sstream> #include <sstream>
#include <algorithm> #include <algorithm>
@ -163,6 +164,7 @@ namespace Compiler
bool Scanner::scanInt (char c, Parser& parser, bool& cont) bool Scanner::scanInt (char c, Parser& parser, bool& cont)
{ {
assert(c != '\0');
std::string value; std::string value;
value += c; value += c;
@ -187,11 +189,7 @@ namespace Compiler
} }
} }
/* if (error)
* value could be empty only if scanInt is called with c == '\0'.
* That is unlikely so it should be replaced by assertion.
*/
if (value.empty() || error)
return false; return false;
TokenLoc loc (mLoc); TokenLoc loc (mLoc);