Skip to content

Commit

Permalink
refactor(ConferenceSpeechActivity): simplify indexing logic
Browse files Browse the repository at this point in the history
  • Loading branch information
paweldomas committed Aug 16, 2016
1 parent a51edb6 commit 61aa116
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions src/main/java/org/jitsi/videobridge/ConferenceSpeechActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -863,25 +863,8 @@ else if (conferenceEndpoints.contains(endpoint))

if (dominantEndpoint != null)
{
int dominantEndpointIndex = -1;

for (int i = 0, count = endpoints.size(); i < count; ++i)
{
if (dominantEndpoint.equals(endpoints.get(i)))
{
dominantEndpointIndex = i;
break;
}
}
if ((dominantEndpointIndex != -1)
&& (dominantEndpointIndex != 0))
{
Endpoint weakReference
= endpoints.remove(dominantEndpointIndex);

endpoints.add(0, weakReference);
endpointsChanged = true;
}
endpoints.remove(dominantEndpoint);
endpoints.add(0, dominantEndpoint);
}

/*
Expand Down

0 comments on commit 61aa116

Please sign in to comment.