From 0112415f3b729b37321cb5b1fade4e4b8c469f8a Mon Sep 17 00:00:00 2001 From: John Scipione Date: Mon, 8 Apr 2013 23:06:23 -0400 Subject: [PATCH] Reverse loop variable avoidance --- src/preferences/appearance/APRView.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/preferences/appearance/APRView.cpp b/src/preferences/appearance/APRView.cpp index f86e4e926a..a61626d4f3 100644 --- a/src/preferences/appearance/APRView.cpp +++ b/src/preferences/appearance/APRView.cpp @@ -227,8 +227,7 @@ APRView::Revert() bool APRView::IsDefaultable() { - int32 count = color_description_count(); - for (int32 i = 0; i < count; i++) { + for (int32 i = color_description_count() - 1; i >= 0; i--) { color_which which = get_color_description(i)->which; if (fCurrentSet.GetColor(which) != fDefaultSet.GetColor(which)) return true; @@ -241,8 +240,7 @@ APRView::IsDefaultable() bool APRView::IsRevertable() { - int32 count = color_description_count(); - for (int32 i = 0; i < count; i++) { + for (int32 i = color_description_count() - 1; i >= 0; i--) { color_which which = get_color_description(i)->which; if (fCurrentSet.GetColor(which) != fPrevSet.GetColor(which)) return true; @@ -274,8 +272,7 @@ APRView::_SetCurrentColor(rgb_color color) void APRView::_UpdateAllColors() { - int32 count = color_description_count(); - for (int32 i = 0; i < count; i++) { + for (int32 i = color_description_count() - 1; i >= 0; i--) { color_which which = get_color_description(i)->which; rgb_color color = fCurrentSet.GetColor(which); set_ui_color(which, color);