diff options
author | Neil <nyamatongwe@gmail.com> | 2017-04-03 18:58:57 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2017-04-03 18:58:57 +1000 |
commit | 9f794eebb386661bc4a2c06005e181683f7f3280 (patch) | |
tree | fe2f10c23a888e3e0e99adece6f0dc1232b34422 | |
parent | be5c8e44aada8184ec1c91b10e8714d85df08ad4 (diff) | |
download | scintilla-mirror-9f794eebb386661bc4a2c06005e181683f7f3280.tar.gz |
Prevent warning from MSVC Code Analysis.
-rw-r--r-- | src/Decoration.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Decoration.cxx b/src/Decoration.cxx index 4817af304..4c85cc60c 100644 --- a/src/Decoration.cxx +++ b/src/Decoration.cxx @@ -89,10 +89,12 @@ void DecorationList::Delete(int indicator) { decoToDelete = root; root = root->Next(); } else { - Decoration *deco=root; - while (deco->Next() && !decoToDelete) { - if (deco->Next() && deco->Next()->Indicator() == indicator) { - decoToDelete = deco->Next(); + Decoration *deco = root; + while (deco && deco->Next() && !decoToDelete) { + // decoNext ensures no warning from MSVC Code Analysis + Decoration *decoNext = deco->Next(); + if (decoNext && deco->Next()->Indicator() == indicator) { + decoToDelete = decoNext; deco->next = decoToDelete->Next(); } else { deco = deco->Next(); |