diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-02-11 11:43:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 11:43:58 +0100 |
commit | 3e3f8a47616327d7faeb17f558bb81a943385e82 (patch) | |
tree | 67558f34ea0725dc7a0e250624ba17fad7eb3287 /core | |
parent | 0b4b24883d8fe7ee3f4c7a861df0bad1d12a319c (diff) | |
parent | a3b938d6dc9c74c3de67ad2c52f69572367a8f11 (diff) |
Merge pull request #36097 from madmiraal/fix-c4715-warning
Prevent Visual Studio compiler throwing C4715: not all control paths return a value.
Diffstat (limited to 'core')
-rw-r--r-- | core/list.h | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/core/list.h b/core/list.h index 0796410a84..6250cec598 100644 --- a/core/list.h +++ b/core/list.h @@ -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) { |