GetSection()で使われているTryGetSetionInner()の実装。
private GetSectionResult TryGetSectionInner(string name, out Section<T> section)
{
section = default(Section<T>);
if(!HasSectionsStringTable)
{
return GetSectionResult.NoSectionsStringTable;
}
int index;
if(!sectionIndicesByName.TryGetValue(name, out index))
{
return GetSectionResult.NoSuchSection;
}
if(index == SectionNameNotUniqueMarker)
{
return GetSectionResult.SectionNameNotUnique;
}
return TryGetSectionInner(index, out section);
}
- sectionIndicesByName.TryGetValue()でindexを取得する。
- TryGetSectionInner(index, out section)でsectionを取得する。