private static ImmutableArray<CppCheckLocation> ParseLocationsSubtree(XmlReader reader, CppCheckStrings strings)
{
var locationBuilder = ImmutableArray.CreateBuilder<CppCheckLocation>();
if (!reader.IsEmptyElement)
{
int startingDepth = reader.Depth;
reader.Read();
while (reader.Depth > startingDepth)
{
Debug.Assert(reader.Depth == startingDepth + 1);
if (reader.NodeType == XmlNodeType.Whitespace)
{
reader.Read();
}
else
{
locationBuilder.Add(CppCheckLocation.Parse(reader, strings));
}
}
}
ImmutableArray<CppCheckLocation> locations = locationBuilder.ToImmutable();
return locations;
}