mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-22 14:55:11 +00:00
Move two things out of the lock
This commit is contained in:
@@ -2029,22 +2029,19 @@ namespace SabreTools.Serialization.Wrappers
|
||||
/// <returns>Section strings on success, null on error</returns>
|
||||
public List<string>? GetSectionStrings(int index)
|
||||
{
|
||||
// If we have no sections
|
||||
if (SectionNames.Length == 0 || SectionTable == null || SectionTable.Length == 0)
|
||||
return null;
|
||||
|
||||
// If the section doesn't exist
|
||||
if (index < 0 || index >= SectionTable.Length)
|
||||
return null;
|
||||
|
||||
lock (_sectionStringDataLock)
|
||||
{
|
||||
// If we have no sections
|
||||
if (SectionNames.Length == 0 || SectionTable == null || SectionTable.Length == 0)
|
||||
{
|
||||
_sectionStringData = [];
|
||||
return null;
|
||||
}
|
||||
|
||||
// Create the section string array if we have to
|
||||
_sectionStringData ??= new List<string>?[SectionNames.Length];
|
||||
|
||||
// If the section doesn't exist
|
||||
if (index < 0 || index >= SectionTable.Length)
|
||||
return null;
|
||||
|
||||
// If we already have cached data, just use that immediately
|
||||
if (_sectionStringData[index] != null)
|
||||
return _sectionStringData[index];
|
||||
|
||||
Reference in New Issue
Block a user