mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-102: Remove unnecessary checks for weight value in the compare function.
This commit is contained in:
committed by
Nick Couchman
parent
58637818ca
commit
aa4c134922
@@ -187,21 +187,10 @@ public class RestrictedGuacamoleTunnelService
|
||||
|
||||
@Override
|
||||
public int compare(ModeledConnection a, ModeledConnection b) {
|
||||
|
||||
int weightA, weightB;
|
||||
// Check if weight of a is non-null and retrieve it.
|
||||
if (a.getConnectionWeight().intValue() > 0)
|
||||
weightA = a.getConnectionWeight().intValue();
|
||||
// In all other cases assign 1 for sorting.
|
||||
else
|
||||
weightA = 1;
|
||||
|
||||
// Check if weight of b is null, assign 1 if it is.
|
||||
if (b.getConnectionWeight().intValue() > 0)
|
||||
weightB = b.getConnectionWeight().intValue();
|
||||
// In all other cases assign 1 for sorting.
|
||||
else
|
||||
weightB = 1;
|
||||
// Get connection weight for the two systems being compared.
|
||||
int weightA = a.getConnectionWeight().intValue();
|
||||
int weightB = b.getConnectionWeight().intValue();
|
||||
|
||||
// Get current active connections, add 1 to both to avoid calculations with 0.
|
||||
int connsA = getActiveConnections(a).size() + 1;
|
||||
|
Reference in New Issue
Block a user