Use assertations to make code cleaner.

This commit is contained in:
Hermann Kraus 2012-07-20 01:49:14 +02:00
parent 525dad7623
commit e48b2f6598

View file

@ -123,26 +123,17 @@ void text_itemizer::create_item_list()
output.push_back(item); output.push_back(item);
if (script_itr->limit == next_position) if (script_itr->limit == next_position)
{ {
if (script_itr == script_end) { assert(script_itr != script_end);
//TODO: EXCEPTION
std::cerr << "Limit error\n";
}
script_itr++; script_itr++;
} }
if (dir_itr->limit == next_position) if (dir_itr->limit == next_position)
{ {
if (dir_itr == dir_end) { assert(dir_itr != dir_end);
//TODO: EXCEPTION
std::cerr << "Limit error\n";
}
dir_itr++; dir_itr++;
} }
if (format_itr->limit == next_position) if (format_itr->limit == next_position)
{ {
if (format_itr == format_end) { assert(format_itr != format_end);
//TODO: EXCEPTION
std::cerr << "Limit error\n";
}
format_itr++; format_itr++;
} }
position = next_position; position = next_position;