Navigation Menu

Skip to content

Commit

Permalink
Use Collection#toArray(T[]) instead.
Browse files Browse the repository at this point in the history
Like the toArray() method, this method acts as bridge between array-based and collection-based APIs. Further, this method allows precise control over the runtime type of the output array, and may, under certain circumstances, be used to save allocation costs.
  • Loading branch information
Florian Spieß committed Nov 7, 2016
1 parent d4e1a04 commit d33af52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/net/dv8tion/jda/core/Permission.java
Expand Up @@ -171,6 +171,6 @@ public static long getRaw(Permission... permissions)

public static long getRaw(Collection<Permission> permissions)
{
return getRaw(permissions.stream().toArray(Permission[]::new));
return getRaw(permissions.toArray(new Permission[permissions.size()]));
}
}

0 comments on commit d33af52

Please sign in to comment.