mirror of
https://github.com/ppy/osu.git
synced 2025-02-16 05:43:20 +08:00
Merge branch 'realm-importer-remove-pointless-fast-hash' into realm-integration/compiled
This commit is contained in:
commit
0f1712a272
@ -294,12 +294,8 @@ namespace osu.Game.Stores
|
|||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// In the case of no matching files, a hash will be generated from the passed archive's <see cref="ArchiveReader.Name"/>.
|
/// In the case of no matching files, a hash will be generated from the passed archive's <see cref="ArchiveReader.Name"/>.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected virtual string ComputeHash(TModel item, ArchiveReader? reader = null)
|
protected virtual string ComputeHash(TModel item)
|
||||||
{
|
{
|
||||||
if (reader != null)
|
|
||||||
// fast hashing for cases where the item's files may not be populated.
|
|
||||||
return computeHashFast(reader);
|
|
||||||
|
|
||||||
// for now, concatenate all hashable files in the set to create a unique hash.
|
// for now, concatenate all hashable files in the set to create a unique hash.
|
||||||
MemoryStream hashable = new MemoryStream();
|
MemoryStream hashable = new MemoryStream();
|
||||||
|
|
||||||
@ -374,7 +370,7 @@ namespace osu.Game.Stores
|
|||||||
// TODO: look into rollback of file additions (or delayed commit).
|
// TODO: look into rollback of file additions (or delayed commit).
|
||||||
item.Files.AddRange(createFileInfos(archive, Files, realm));
|
item.Files.AddRange(createFileInfos(archive, Files, realm));
|
||||||
|
|
||||||
item.Hash = ComputeHash(item, archive);
|
item.Hash = ComputeHash(item);
|
||||||
|
|
||||||
// TODO: we may want to run this outside of the transaction.
|
// TODO: we may want to run this outside of the transaction.
|
||||||
await Populate(item, archive, realm, cancellationToken).ConfigureAwait(false);
|
await Populate(item, archive, realm, cancellationToken).ConfigureAwait(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user