mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-25 04:14:13 +08:00
use non-threadsafe Lazy constructor where appropriate.
This commit is contained in:
parent
248413c3fe
commit
546b5f986f
@ -146,7 +146,7 @@ namespace GameRes.Formats.KiriKiri
|
|||||||
header_stream = ZLibCompressor.DeCompress (input);
|
header_stream = ZLibCompressor.DeCompress (input);
|
||||||
}
|
}
|
||||||
|
|
||||||
var crypt_algorithm = new Lazy<ICrypt> (QueryCryptAlgorithm);
|
var crypt_algorithm = new Lazy<ICrypt> (QueryCryptAlgorithm, false);
|
||||||
|
|
||||||
var filename_map = new Dictionary<uint, string>();
|
var filename_map = new Dictionary<uint, string>();
|
||||||
var dir = new List<Entry>();
|
var dir = new List<Entry>();
|
||||||
|
@ -127,7 +127,7 @@ namespace GameRes.Formats.Tactics
|
|||||||
m_packed_size = m_file.View.ReadUInt32 (0x10);
|
m_packed_size = m_file.View.ReadUInt32 (0x10);
|
||||||
m_unpacked_size = m_file.View.ReadUInt32 (0x14);
|
m_unpacked_size = m_file.View.ReadUInt32 (0x14);
|
||||||
m_count = m_file.View.ReadInt32 (0x18);
|
m_count = m_file.View.ReadInt32 (0x18);
|
||||||
m_dir = new Lazy<List<Entry>> (() => new List<Entry> (m_count));
|
m_dir = new Lazy<List<Entry>> (() => new List<Entry> (m_count), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Entry> ReadIndex ()
|
public List<Entry> ReadIndex ()
|
||||||
|
@ -72,7 +72,7 @@ namespace GameRes
|
|||||||
if (entry.Size < 4)
|
if (entry.Size < 4)
|
||||||
return null;
|
return null;
|
||||||
var filename = entry.Name;
|
var filename = entry.Name;
|
||||||
var ext = new Lazy<string> (() => Path.GetExtension (filename).TrimStart ('.').ToLowerInvariant());
|
var ext = new Lazy<string> (() => Path.GetExtension (filename).TrimStart ('.').ToLowerInvariant(), false);
|
||||||
var file = VFS.OpenView (entry);
|
var file = VFS.OpenView (entry);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -157,7 +157,7 @@ namespace GameRes
|
|||||||
uint signature = FormatCatalog.ReadSignature (file);
|
uint signature = FormatCatalog.ReadSignature (file);
|
||||||
Lazy<string> ext = null;
|
Lazy<string> ext = null;
|
||||||
if (!string.IsNullOrEmpty (filename))
|
if (!string.IsNullOrEmpty (filename))
|
||||||
ext = new Lazy<string> (() => Path.GetExtension (filename).TrimStart ('.').ToLowerInvariant());
|
ext = new Lazy<string> (() => Path.GetExtension (filename).TrimStart ('.').ToLowerInvariant(), false);
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
var range = FormatCatalog.Instance.LookupSignature<ImageFormat> (signature);
|
var range = FormatCatalog.Instance.LookupSignature<ImageFormat> (signature);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user