From 9c53f7ceade14dd881eecceff8de890cef9699fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= Date: Mon, 17 Aug 2015 18:10:17 +0300 Subject: [PATCH] Refactor|libcore|Info: Don't throw exceptions when parsing values --- doomsday/sdk/libcore/src/data/info.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/doomsday/sdk/libcore/src/data/info.cpp b/doomsday/sdk/libcore/src/data/info.cpp index 37b906127f..b26a9f7a1c 100644 --- a/doomsday/sdk/libcore/src/data/info.cpp +++ b/doomsday/sdk/libcore/src/data/info.cpp @@ -333,23 +333,20 @@ DENG2_PIMPL(Info) } // Check if it is the beginning of a string literal. + // The value will be composed of any number of sub-strings. if(peekToken() == "\"") { - try + while(peekToken() == "\"") { - // The value will be composed of any number of sub-strings. - forever { value.text += parseString(); } - } - catch(de::Error const &) - { - // No more strings to append. - return value; + value.text += parseString(); } } - - // Then it must be a single token. - value = peekToken(); - nextToken(); + else + { + // Then it must be a single token. + value = peekToken(); + nextToken(); + } return value; }