Skip to content

Commit

Permalink
Use ordinal comparer for string keyed dictionaries
Browse files Browse the repository at this point in the history
  • Loading branch information
jbevain committed Nov 2, 2011
1 parent caf647b commit 74a6971
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Mono.Cecil.Metadata/Buffers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ protected HeapBuffer (int length)

class StringHeapBuffer : HeapBuffer {

readonly Dictionary<string, uint> strings = new Dictionary<string, uint> ();
readonly Dictionary<string, uint> strings = new Dictionary<string, uint> (StringComparer.Ordinal);

public sealed override bool IsEmpty {
get { return length <= 1; }
Expand Down
2 changes: 1 addition & 1 deletion Mono.Cecil/DefaultAssemblyResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class DefaultAssemblyResolver : BaseAssemblyResolver {

public DefaultAssemblyResolver ()
{
cache = new Dictionary<string, AssemblyDefinition> ();
cache = new Dictionary<string, AssemblyDefinition> (StringComparer.Ordinal);
}

public override AssemblyDefinition Resolve (AssemblyNameReference name)
Expand Down
2 changes: 1 addition & 1 deletion Mono.Cecil/MetadataSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ sealed class MetadataSystem {

static void InitializePrimitives ()
{
primitive_value_types = new Dictionary<string, Row<ElementType, bool>> (18) {
primitive_value_types = new Dictionary<string, Row<ElementType, bool>> (18, StringComparer.Ordinal) {
{ "Void", new Row<ElementType, bool> (ElementType.Void, false) },
{ "Boolean", new Row<ElementType, bool> (ElementType.Boolean, true) },
{ "Char", new Row<ElementType, bool> (ElementType.Char, true) },
Expand Down

0 comments on commit 74a6971

Please sign in to comment.