Skip to content

Commit

Permalink
Optimize relocation counting in DehydratedDataNode.GetData (#103202)
Browse files Browse the repository at this point in the history
  • Loading branch information
filipnavara committed Jun 10, 2024
1 parent 2bd1586 commit c1cebef
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;

using Internal.Runtime;
using Internal.Text;
Expand Down Expand Up @@ -74,8 +75,7 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false)
ISymbolNode target = reloc.Target;
if (target is ISymbolNodeWithLinkage withLinkage)
target = withLinkage.NodeForLinkage(factory);
relocOccurences.TryGetValue(target, out int num);
relocOccurences[target] = ++num;
CollectionsMarshal.GetValueRefOrAddDefault(relocOccurences, target, out _)++;
}
}

Expand Down

0 comments on commit c1cebef

Please sign in to comment.