Skip to content
This repository was archived by the owner on Sep 7, 2023. It is now read-only.

Commit 051233b

Browse files
author
Alistair Crook
authored
Remove duplication in getPlayersByRoleType (typedb#190)
## What is the goal of this PR? In getPlayersByRoleType, a hasmap is created, filled out with the contents of an existing hashmap, and returned. This PR removes this and simply returns the existing hashmap.
1 parent 345e8ca commit 051233b

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

concept/thing/impl/RelationImpl.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,7 @@ public Map<RoleTypeImpl, List<ThingImpl>> getPlayersByRoleType() {
102102
rolePlayerMap.put(role, new ArrayList<>(Collections.singletonList(player)));
103103
}
104104
});
105-
106-
final Map<RoleTypeImpl, List<ThingImpl>> result = new HashMap<>();
107-
for (Map.Entry<RoleTypeImpl, List<ThingImpl>> entry : rolePlayerMap.entrySet()) {
108-
result.put(entry.getKey(), entry.getValue());
109-
}
110-
return result;
105+
return rolePlayerMap;
111106
}
112107

113108
@Override

0 commit comments

Comments
 (0)