Loop count premature optimization
This commit is contained in:
@@ -78,7 +78,8 @@ APRView::APRView(const char* name)
|
|||||||
fScrollView = new BScrollView("ScrollView", fAttrList, 0, false, true);
|
fScrollView = new BScrollView("ScrollView", fAttrList, 0, false, true);
|
||||||
fScrollView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
fScrollView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
for (int32 i = 0; i < color_description_count(); i++) {
|
int32 count = color_description_count();
|
||||||
|
for (int32 i = 0; i < count; i++) {
|
||||||
const ColorDescription& description = *get_color_description(i);
|
const ColorDescription& description = *get_color_description(i);
|
||||||
const char* text = B_TRANSLATE_NOCOLLECT(description.text);
|
const char* text = B_TRANSLATE_NOCOLLECT(description.text);
|
||||||
color_which which = description.which;
|
color_which which = description.which;
|
||||||
@@ -178,7 +179,8 @@ APRView::MessageReceived(BMessage *msg)
|
|||||||
void
|
void
|
||||||
APRView::LoadSettings()
|
APRView::LoadSettings()
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < color_description_count(); i++) {
|
int32 count = color_description_count();
|
||||||
|
for (int32 i = 0; i < count; i++) {
|
||||||
color_which which = get_color_description(i)->which;
|
color_which which = get_color_description(i)->which;
|
||||||
fCurrentSet.SetColor(which, ui_color(which));
|
fCurrentSet.SetColor(which, ui_color(which));
|
||||||
}
|
}
|
||||||
@@ -214,11 +216,13 @@ APRView::Revert()
|
|||||||
bool
|
bool
|
||||||
APRView::IsDefaultable()
|
APRView::IsDefaultable()
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < color_description_count(); i++) {
|
int32 count = color_description_count();
|
||||||
|
for (int32 i = 0; i < count; i++) {
|
||||||
color_which which = get_color_description(i)->which;
|
color_which which = get_color_description(i)->which;
|
||||||
if (fCurrentSet.GetColor(which) != fDefaultSet.GetColor(which))
|
if (fCurrentSet.GetColor(which) != fDefaultSet.GetColor(which))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,11 +230,13 @@ APRView::IsDefaultable()
|
|||||||
bool
|
bool
|
||||||
APRView::IsRevertable()
|
APRView::IsRevertable()
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < color_description_count(); i++) {
|
int32 count = color_description_count();
|
||||||
|
for (int32 i = 0; i < count; i++) {
|
||||||
color_which which = get_color_description(i)->which;
|
color_which which = get_color_description(i)->which;
|
||||||
if (fCurrentSet.GetColor(which) != fPrevSet.GetColor(which))
|
if (fCurrentSet.GetColor(which) != fPrevSet.GetColor(which))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -265,7 +271,8 @@ APRView::_UpdateControls()
|
|||||||
void
|
void
|
||||||
APRView::_UpdateAllColors()
|
APRView::_UpdateAllColors()
|
||||||
{
|
{
|
||||||
for (int32 i = 0; i < color_description_count(); i++) {
|
int32 count = color_description_count();
|
||||||
|
for (int32 i = 0; i < count; i++) {
|
||||||
color_which which = get_color_description(i)->which;
|
color_which which = get_color_description(i)->which;
|
||||||
rgb_color color = fCurrentSet.GetColor(which);
|
rgb_color color = fCurrentSet.GetColor(which);
|
||||||
set_ui_color(which, color);
|
set_ui_color(which, color);
|
||||||
|
|||||||
Reference in New Issue
Block a user