1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 06:42:56 +08:00

Use string.Join in GetMessagesRequest.

This commit is contained in:
Huo Yaoyuan 2017-05-18 01:43:11 +08:00
parent b5d7211cd6
commit e2b1fcc088

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using osu.Framework.IO.Network; using osu.Framework.IO.Network;
using osu.Game.Online.Chat; using osu.Game.Online.Chat;
@ -20,10 +21,7 @@ namespace osu.Game.Online.API.Requests
protected override WebRequest CreateWebRequest() protected override WebRequest CreateWebRequest()
{ {
string channelString = string.Empty; string channelString = string.Join(",", channels.Select(x => x.Id));
foreach (Channel c in channels)
channelString += c.Id + ",";
channelString = channelString.TrimEnd(',');
var req = base.CreateWebRequest(); var req = base.CreateWebRequest();
req.AddParameter(@"channels", channelString); req.AddParameter(@"channels", channelString);