From e48b2f65981abdaca2006f1598fcad842b82ac6e Mon Sep 17 00:00:00 2001 From: Hermann Kraus Date: Fri, 20 Jul 2012 01:49:14 +0200 Subject: [PATCH] Use assertations to make code cleaner. --- src/text/itemizer.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/text/itemizer.cpp b/src/text/itemizer.cpp index 8c0b42b6e..c0847f135 100644 --- a/src/text/itemizer.cpp +++ b/src/text/itemizer.cpp @@ -123,26 +123,17 @@ void text_itemizer::create_item_list() output.push_back(item); if (script_itr->limit == next_position) { - if (script_itr == script_end) { - //TODO: EXCEPTION - std::cerr << "Limit error\n"; - } + assert(script_itr != script_end); script_itr++; } if (dir_itr->limit == next_position) { - if (dir_itr == dir_end) { - //TODO: EXCEPTION - std::cerr << "Limit error\n"; - } + assert(dir_itr != dir_end); dir_itr++; } if (format_itr->limit == next_position) { - if (format_itr == format_end) { - //TODO: EXCEPTION - std::cerr << "Limit error\n"; - } + assert(format_itr != format_end); format_itr++; } position = next_position;