diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-15 17:54:59 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-15 17:54:59 +0000 |
commit | 6810ea5c4a763558a6c344780047a5249c317d54 (patch) | |
tree | 6f40050282b59dbca536367f43aca56995f44eab | |
parent | dda7e3f7a23beacbed249d5ae9b8169bdafaad44 (diff) |
CID-40
Checker: DEADCODE
Function: LLAvatarListItem::getItemChildView(LLAvatarListItem::e_avatar_item_child)
File: /indra/newview/llavatarlistitem.cpp
simply very redundant checking. removed the least-paranoid.
-rw-r--r-- | indra/newview/llavatarlistitem.cpp | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 846b2843dd..5011b191f4 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -526,21 +526,30 @@ void LLAvatarListItem::updateChildren() LLView* LLAvatarListItem::getItemChildView(EAvatarListItemChildIndex child_view_index) { LLView* child_view = mAvatarName; - if (child_view_index < 0 || ALIC_COUNT <= child_view_index) - { - LL_WARNS("AvatarItemReshape") << "Child view index is out of range: " << child_view_index << LL_ENDL; - return child_view; - } + switch (child_view_index) { - case ALIC_ICON: child_view = mAvatarIcon; break; - case ALIC_NAME: child_view = mAvatarName; break; - case ALIC_INTERACTION_TIME: child_view = mLastInteractionTime; break; - case ALIC_SPEAKER_INDICATOR: child_view = mSpeakingIndicator; break; - case ALIC_INFO_BUTTON: child_view = mInfoBtn; break; - case ALIC_PROFILE_BUTTON: child_view = mProfileBtn; break; + case ALIC_ICON: + child_view = mAvatarIcon; + break; + case ALIC_NAME: + child_view = mAvatarName; + break; + case ALIC_INTERACTION_TIME: + child_view = mLastInteractionTime; + break; + case ALIC_SPEAKER_INDICATOR: + child_view = mSpeakingIndicator; + break; + case ALIC_INFO_BUTTON: + child_view = mInfoBtn; + break; + case ALIC_PROFILE_BUTTON: + child_view = mProfileBtn; + break; default: LL_WARNS("AvatarItemReshape") << "Unexpected child view index is passed: " << child_view_index << LL_ENDL; + // leave child_view untouched } return child_view; |