Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove parallelity in file props #183

Merged
merged 2 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Xive/Props/FileProps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
namespace Xive.Props
{
/// <summary>
/// Props which are read into memory from internal xml document _catalog.xml in the given comb.
/// Props which are read into memory from internal document props.cat in the given comb.
/// Props are read from memory.
/// Props are updated into the comb.
/// </summary>
Expand All @@ -46,7 +46,7 @@ public sealed class FileProps : IProps
private readonly string scope;

/// <summary>
/// Props which are read into memory from internal xml document props.cat in the given comb.
/// Props which are read into memory from internal document props.cat in the given comb.
/// Props are read from memory.
/// Props are updated into the comb.
/// </summary>
Expand All @@ -70,12 +70,12 @@ public FileProps(IContents mem, string scope, string id)
).AsString();

var cachedProps = new RamProps();
Parallel.ForEach(stringProps.Split(new char[] { '\r' }, StringSplitOptions.RemoveEmptyEntries), (stringProp) =>
foreach (var line in stringProps.Split(new char[] { '\r' }, StringSplitOptions.RemoveEmptyEntries))
{
var parts = stringProp.Split(':');
var parts = line.Split(':');
if (parts.Length != 2)
{
throw new ApplicationException($"A property of {scope}/{id} has an invalid format: {stringProp}");
throw new ApplicationException($"A property of {scope}/{id} has an invalid format: {line}");
}
var name = XmlConvert.DecodeName(parts[0].Trim());
var values = parts[1].Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
Expand All @@ -84,7 +84,7 @@ public FileProps(IContents mem, string scope, string id)
values[i] = XmlConvert.DecodeName(values[i]);
}
cachedProps.Refined(name, values);
});
}
return cachedProps;
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/Xive/Xive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<Version>6.0.3</Version>
<Version>6.0.4</Version>
<DocumentationFile>$(MSBuildThisFileDirectory)bin\$(Configuration)\$(TargetFramework)\Xive.xml</DocumentationFile>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<LangVersion>10</LangVersion>
<SignAssembly>True</SignAssembly>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\sgKey.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

Expand Down