summaryrefslogtreecommitdiff
path: root/xml2cmp
diff options
context:
space:
mode:
Diffstat (limited to 'xml2cmp')
-rw-r--r--xml2cmp/source/support/list.hxx5
-rw-r--r--xml2cmp/source/xcd/xmlelem.cxx2
2 files changed, 2 insertions, 5 deletions
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 <class XY>
void
DynamicList<XY>::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_;
}