From f5cc5634ebb1fd3834d963534650c9f62f00783a Mon Sep 17 00:00:00 2001 From: Seo Sanghyeon Date: Wed, 29 Sep 2010 13:59:36 +0200 Subject: Removes is_valid_index method for future migration to STL --- xml2cmp/source/support/list.hxx | 5 +---- xml2cmp/source/xcd/xmlelem.cxx | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'xml2cmp') diff --git a/xml2cmp/source/support/list.hxx b/xml2cmp/source/support/list.hxx index 163cd74ece83..7fbd71412ae3 100644 --- a/xml2cmp/source/support/list.hxx +++ b/xml2cmp/source/support/list.hxx @@ -72,9 +72,6 @@ class List unsigned size() const { return len; } unsigned space() const { return allocated; } - bool is_valid_index( - unsigned n) const - { return n < len; } // ACCESS XX & front() { return elem(0); } XX & back() { return elem(len-1); } @@ -238,7 +235,7 @@ template void DynamicList::remove( unsigned pos ) { - if (!this->is_valid_index(pos) ) + if (pos >= this->len) return; this->len--; delete this->inhalt[pos]; diff --git a/xml2cmp/source/xcd/xmlelem.cxx b/xml2cmp/source/xcd/xmlelem.cxx index 10662b3a40d4..006197465de6 100644 --- a/xml2cmp/source/xcd/xmlelem.cxx +++ b/xml2cmp/source/xcd/xmlelem.cxx @@ -207,7 +207,7 @@ MultipleTextElement::Data( unsigned i_nNr ) const { static const Simstr sNull_; - if (aContent.is_valid_index(i_nNr)) + if (i_nNr < aContent.size()) return aContent[i_nNr]; return sNull_; } -- cgit v1.2.3