diff options
author | Graham Linden <graham@lindenlab.com> | 2018-08-16 22:00:53 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-08-16 22:00:53 +0100 |
commit | 597d28ad343d39f0812f7403119cc817dfab3d64 (patch) | |
tree | e47fb05e89bbf9392f91554904a8d97acaca24c1 | |
parent | 5ddd9d0c977bea070008baefdb452e808077f98c (diff) |
Fix constness of LLSettingsVODay::buildDeepCloneAndUncompress.
-rw-r--r-- | indra/llinventory/llsettingsdaycycle.cpp | 11 | ||||
-rw-r--r-- | indra/llinventory/llsettingsdaycycle.h | 1 | ||||
-rw-r--r-- | indra/newview/llsettingsvo.cpp | 4 |
3 files changed, 13 insertions, 3 deletions
diff --git a/indra/llinventory/llsettingsdaycycle.cpp b/indra/llinventory/llsettingsdaycycle.cpp index 4a99be0c4b..8ca4ca4a6d 100644 --- a/indra/llinventory/llsettingsdaycycle.cpp +++ b/indra/llinventory/llsettingsdaycycle.cpp @@ -593,7 +593,16 @@ LLSettingsDay::validation_list_t LLSettingsDay::validationList() return validation; } -LLSettingsDay::CycleTrack_t &LLSettingsDay::getCycleTrack(S32 track) +LLSettingsDay::CycleTrack_t& LLSettingsDay::getCycleTrack(S32 track) +{ + static CycleTrack_t emptyTrack; + if (mDayTracks.size() <= track) + return emptyTrack; + + return mDayTracks[track]; +} + +const LLSettingsDay::CycleTrack_t& LLSettingsDay::getCycleTrackConst(S32 track) const { static CycleTrack_t emptyTrack; if (mDayTracks.size() <= track) diff --git a/indra/llinventory/llsettingsdaycycle.h b/indra/llinventory/llsettingsdaycycle.h index 878eec8301..46dc0cec74 100644 --- a/indra/llinventory/llsettingsdaycycle.h +++ b/indra/llinventory/llsettingsdaycycle.h @@ -118,6 +118,7 @@ public: void setInitialized(bool value = true) { mInitialized = value; } CycleTrack_t & getCycleTrack(S32 track); + const CycleTrack_t & getCycleTrackConst(S32 track) const; bool clearCycleTrack(S32 track); bool replaceCycleTrack(S32 track, const CycleTrack_t &source); bool isTrackEmpty(S32 track) const; diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index c410f0d955..ef74ecf46f 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -1101,8 +1101,8 @@ LLSettingsDay::ptr_t LLSettingsVODay::buildDeepCloneAndUncompress() const for (S32 i = 0; i < LLSettingsDay::TRACK_MAX; ++i) { - LLSettingsDay::CycleTrack_t track = getCycleTrack(i); - LLSettingsDay::CycleTrack_t::iterator iter = track.begin(); + const LLSettingsDay::CycleTrack_t& track = getCycleTrackConst(i); + LLSettingsDay::CycleTrack_t::const_iterator iter = track.begin(); while (iter != track.end()) { // 'Unpack', usually for editing |