summaryrefslogtreecommitdiff
path: root/indra/llui/llloadingindicator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llloadingindicator.cpp')
-rw-r--r--indra/llui/llloadingindicator.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/indra/llui/llloadingindicator.cpp b/indra/llui/llloadingindicator.cpp
index 8dec6ea9df..f8b029e19c 100644
--- a/indra/llui/llloadingindicator.cpp
+++ b/indra/llui/llloadingindicator.cpp
@@ -78,10 +78,8 @@ void LLLoadingIndicator::Data::initSingleton()
LLPointer<LLUIImage> LLLoadingIndicator::Data::getNextImage(S8& idx) const
{
- // Actually selects previous image because
- // current images seem to be in wrong order;
- // performs array bounds checking.
- idx = idx > 0 ? llmin(NIMAGES-1, idx-1) : NIMAGES-1;
+ // Calculate next index, performing array bounds checking.
+ idx = (idx >= NIMAGES || idx < 0) ? 0 : (idx + 1) % NIMAGES;
return mImages[idx];
}