From f0ae109b696671c5773a5084a7329d0b164b7735 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 2 Feb 2018 12:36:15 -0500 Subject: STORM-2145 Tiny optimizations --- indra/newview/llfloaterpreferenceviewadvanced.cpp | 60 +++-------------------- indra/newview/llfloaterpreferenceviewadvanced.h | 4 +- 2 files changed, 10 insertions(+), 54 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterpreferenceviewadvanced.cpp b/indra/newview/llfloaterpreferenceviewadvanced.cpp index 055c6f2232..791ff79d87 100644 --- a/indra/newview/llfloaterpreferenceviewadvanced.cpp +++ b/indra/newview/llfloaterpreferenceviewadvanced.cpp @@ -70,62 +70,18 @@ BOOL LLFloaterPreferenceViewAdvanced::postBuild() return TRUE; } -void LLFloaterPreferenceViewAdvanced::updateCameraControl(LLVector3 vector) +void LLFloaterPreferenceViewAdvanced::updateCameraControl(const LLVector3& vector) { - LLSpinCtrl* spinnerx = getChild("camera_x"); - LLSpinCtrl* spinnery = getChild("camera_y"); - LLSpinCtrl* spinnerz = getChild("camera_z"); - - if (!spinnerx || !spinnery || !spinnerz) - { - LL_WARNS() << "Could not find all desired UI camera elements" - << LL_ENDL; - return; - } - - if (!spinnerx->hasFocus()) - { - spinnerx->setValue(vector[VX]); - } - - if (!spinnery->hasFocus()) - { - spinnery->setValue(vector[VY]); - } - - if (!spinnerz->hasFocus()) - { - spinnerz->setValue(vector[VZ]); - } + getChild("camera_x")->setValue(vector[VX]); + getChild("camera_y")->setValue(vector[VY]); + getChild("camera_z")->setValue(vector[VZ]); } -void LLFloaterPreferenceViewAdvanced::updateFocusControl(LLVector3d vector3d) +void LLFloaterPreferenceViewAdvanced::updateFocusControl(const LLVector3d& vector3d) { - LLSpinCtrl* spinnerx = getChild("focus_x"); - LLSpinCtrl* spinnery = getChild("focus_y"); - LLSpinCtrl* spinnerz = getChild("focus_z"); - - if (!spinnerx || !spinnery || !spinnerz) - { - LL_WARNS() << "Could not find all desired UI focus elements" - << LL_ENDL; - return; - } - - if (!spinnerx->hasFocus()) - { - spinnerx->setValue(vector3d[VX]); - } - - if (!spinnery->hasFocus()) - { - spinnery->setValue(vector3d[VY]); - } - - if (!spinnerz->hasFocus()) - { - spinnerz->setValue(vector3d[VZ]); - } + getChild("focus_x")->setValue(vector3d[VX]); + getChild("focus_y")->setValue(vector3d[VY]); + getChild("focus_z")->setValue(vector3d[VZ]); } void LLFloaterPreferenceViewAdvanced::draw() diff --git a/indra/newview/llfloaterpreferenceviewadvanced.h b/indra/newview/llfloaterpreferenceviewadvanced.h index 5b63770059..8f4b594605 100644 --- a/indra/newview/llfloaterpreferenceviewadvanced.h +++ b/indra/newview/llfloaterpreferenceviewadvanced.h @@ -43,8 +43,8 @@ public: void onCommitSettings(); void onClickCancel(); void onClickOk(); - void updateCameraControl(LLVector3 vector); - void updateFocusControl(LLVector3d vector3d); + void updateCameraControl(const LLVector3& vector); + void updateFocusControl(const LLVector3d& vector3d); private: virtual ~LLFloaterPreferenceViewAdvanced(); -- cgit v1.2.3