forked from Shardstone/trail-into-darkness
updated linq calls to zero allocation zlinq
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
using Jovian.SaveSystem;
|
||||
using Nox.Core;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using ZLinq;
|
||||
using UnityEngine;
|
||||
using PlayMode = Nox.Core.PlayMode;
|
||||
|
||||
@@ -12,13 +12,13 @@ namespace Nox.Game {
|
||||
ISaveSystem saveSystem,
|
||||
GameDataState gameDataState,
|
||||
ref AdventureData adventureData) {
|
||||
var sessions = saveSystem.GetAllSessions().OrderByDescending(s => s.lastSaveDateUtc).ToList();
|
||||
var sessions = saveSystem.GetAllSessions().AsValueEnumerable().OrderByDescending(s => s.lastSaveDateUtc).ToList();
|
||||
if(sessions.Count == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var latestSession = sessions[0];
|
||||
var slots = saveSystem.GetSlots(latestSession.sessionId).OrderByDescending(s => s.timestampUtc).ToList();
|
||||
var slots = saveSystem.GetSlots(latestSession.sessionId).AsValueEnumerable().OrderByDescending(s => s.timestampUtc).ToList();
|
||||
if(slots.Count == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user