Skip to content
This repository has been archived by the owner on Dec 6, 2020. It is now read-only.

Commit

Permalink
reNX: Fix small issue where nodes are parsed multiple times. Target .…
Browse files Browse the repository at this point in the history
…NET 4.

CLR 4 shows large improvements in.. basically everything. No point not targetting it. The code will still support .NET 3.5. In fact, the code can run on .NET 2.0, if NXFile.ResolvePath is rewritten without LINQ.

Signed-off-by: angelsl <[email protected]>
  • Loading branch information
angelsl committed Jun 24, 2013
1 parent 8af6382 commit ecb8d40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions NXProperties/NXNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ private unsafe void CheckChild(bool parse = true, bool map = false) {

switch ((parse ? 1 : 0) | (map ? 2 : 0)) {
case 1:
for (uint i = _nodeData->FirstChildID; i < end; ++i, ++start) _file._nodes[i] = ParseNode(start, this, _file);
for (uint i = _nodeData->FirstChildID; i < end; ++i, ++start) if(_file._nodes[i] == null) _file._nodes[i] = ParseNode(start, this, _file);
_childinit = true;
break;
case 2:
Expand All @@ -196,7 +196,9 @@ private unsafe void CheckChild(bool parse = true, bool map = false) {
break;
case 3:
_children = new Dictionary<string, NXNode>(_nodeData->ChildCount);
for (uint i = _nodeData->FirstChildID; i < end; ++i, ++start) AddChild(_file._nodes[i] = ParseNode(start, this, _file));
for (uint i = _nodeData->FirstChildID; i < end; ++i, ++start)
if (_file._nodes[i] == null) AddChild(_file._nodes[i] = ParseNode(start, this, _file));
else AddChild(_file._nodes[i]);
_childinit = true;
break;
default:
Expand Down
4 changes: 3 additions & 1 deletion reNX.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>reNX</RootNamespace>
<AssemblyName>reNX</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand All @@ -32,6 +32,7 @@
<CodeAnalysisRuleDirectories>;D:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules;D:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<NoWarn>1584</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
Expand All @@ -52,6 +53,7 @@
<CodeAnalysisIgnoreBuiltInRules>false</CodeAnalysisIgnoreBuiltInRules>
<DocumentationFile>bin\Release\reNX.XML</DocumentationFile>
<NoWarn>1584</NoWarn>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down

0 comments on commit ecb8d40

Please sign in to comment.