Commit 07d21b84 by Marcel Admiraal

Refactor List operator[] to prevent compiler warnings.

Prevents GCC compiler throwing: control reaches end of non-void function. Prevents Visual Studio throwing C4715: not all control paths return a value.
parent 6fb64054
......@@ -456,17 +456,12 @@ public:
Element *I = front();
int c = 0;
while (I) {
if (c == p_index) {
return I->get();
}
while (c < p_index) {
I = I->next();
c++;
}
CRASH_NOW(); // bug!!
return I->get();
}
const T &operator[](int p_index) const {
......@@ -475,17 +470,12 @@ public:
const Element *I = front();
int c = 0;
while (I) {
if (c == p_index) {
return I->get();
}
while (c < p_index) {
I = I->next();
c++;
}
CRASH_NOW(); // bug!!
return I->get();
}
void move_to_back(Element *p_I) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment