Replace IEnumerable with IReadonlyCollection where possible

This commit is contained in:
Christopher F
2016-07-30 21:37:57 -04:00
parent 3c5788bbfc
commit c54f6addd2
2 changed files with 5 additions and 5 deletions

View File

@@ -8,25 +8,25 @@ namespace Discord.WebSocket.Extensions
public static IUser GetUser(this IDMChannel channel, ulong id)
=> GetSocketDMChannel(channel).GetUser(id);
public static IEnumerable<IUser> GetUsers(this IDMChannel channel)
public static IReadOnlyCollection<IUser> GetUsers(this IDMChannel channel)
=> GetSocketDMChannel(channel).Users;
public static IUser GetUser(this IGroupChannel channel, ulong id)
=> GetSocketGroupChannel(channel).GetUser(id);
public static IEnumerable<IUser> GetUsers(this IGroupChannel channel)
public static IReadOnlyCollection<IUser> GetUsers(this IGroupChannel channel)
=> GetSocketGroupChannel(channel).Users;
public static IGuildUser GetUser(this ITextChannel channel, ulong id)
=> GetSocketTextChannel(channel).GetUser(id);
public static IEnumerable<IGuildUser> GetUsers(this ITextChannel channel)
public static IReadOnlyCollection<IGuildUser> GetUsers(this ITextChannel channel)
=> GetSocketTextChannel(channel).Members;
public static IGuildUser GetUser(this IVoiceChannel channel, ulong id)
=> GetSocketVoiceChannel(channel).GetUser(id);
public static IEnumerable<IGuildUser> GetUsers(this IVoiceChannel channel)
public static IReadOnlyCollection<IGuildUser> GetUsers(this IVoiceChannel channel)
=> GetSocketVoiceChannel(channel).Members;
internal static SocketDMChannel GetSocketDMChannel(IDMChannel channel)

View File

@@ -12,7 +12,7 @@ namespace Discord.WebSocket.Extensions
public static IGuildChannel GetChannel(this IGuild guild, ulong id) =>
GetSocketGuild(guild).GetChannel(id);
public static IEnumerable<IGuildChannel> GetChannels(this IGuild guild) =>
public static IReadOnlyCollection<IGuildChannel> GetChannels(this IGuild guild) =>
GetSocketGuild(guild).Channels;
public static ITextChannel GetTextChannel(this IGuild guild, ulong id) =>