Optimise file lookups and other database operations

FirstOrDefault when called on a TableQuery with a predicate doesn't use table indices
This commit is contained in:
Dean Herbert
2017-08-01 17:37:21 +09:00
parent e7e822ecd5
commit 3b1166d1e6
5 changed files with 10 additions and 12 deletions

View File

@ -174,7 +174,7 @@ namespace osu.Game.Beatmaps
if (!beatmaps.Delete(beatmapSet)) return;
if (!beatmapSet.Protected)
files.Dereference(beatmapSet.Files.Select(f => f.FileInfo));
files.Dereference(beatmapSet.Files.Select(f => f.FileInfo).ToArray());
}
/// <summary>
@ -188,7 +188,7 @@ namespace osu.Game.Beatmaps
if (!beatmaps.Undelete(beatmapSet)) return;
if (!beatmapSet.Protected)
files.Reference(beatmapSet.Files.Select(f => f.FileInfo));
files.Reference(beatmapSet.Files.Select(f => f.FileInfo).ToArray());
}
/// <summary>