List to IEnumerable changes
Removed use of tolist()
This commit is contained in:
@@ -1051,7 +1051,7 @@ public class QuestHelper(
|
||||
/// </summary>
|
||||
/// <param name="pmcProfile">profile to update</param>
|
||||
/// <param name="statuses">statuses quests should have added to profile</param>
|
||||
public void AddAllQuestsToProfile(PmcData pmcProfile, List<QuestStatusEnum> statuses)
|
||||
public void AddAllQuestsToProfile(PmcData pmcProfile, IEnumerable<QuestStatusEnum> statuses)
|
||||
{
|
||||
// Iterate over all quests in db
|
||||
var quests = databaseService.GetQuests();
|
||||
@@ -1074,7 +1074,7 @@ public class QuestHelper(
|
||||
{
|
||||
QId = key,
|
||||
StartTime = timeUtil.GetTimeStamp(),
|
||||
Status = statuses[^1], // Get last status in list as currently active status
|
||||
Status = statuses.Last(), // Get last status in list as currently active status
|
||||
StatusTimers = statusesDict,
|
||||
CompletedConditions = [],
|
||||
AvailableAfter = 0,
|
||||
|
||||
@@ -21,14 +21,14 @@ public class WebSocketServer(
|
||||
|
||||
private async Task HandleWebSocket(HttpContext context, WebSocket webSocket)
|
||||
{
|
||||
var socketHandlers = _webSocketConnectionHandler
|
||||
.Where(wsh => context.Request.Path.Value.Contains(wsh.GetHookUrl()))
|
||||
.ToList();
|
||||
var socketHandlers = _webSocketConnectionHandler.Where(wsh =>
|
||||
context.Request.Path.Value.Contains(wsh.GetHookUrl())
|
||||
);
|
||||
|
||||
var cts = new CancellationTokenSource();
|
||||
var wsToken = cts.Token;
|
||||
|
||||
if (socketHandlers.Count == 0)
|
||||
if (!socketHandlers.Any())
|
||||
{
|
||||
var message =
|
||||
$"Socket connection received for url {context.Request.Path.Value}, but there is no websocket handler configured for it!";
|
||||
|
||||
Reference in New Issue
Block a user