Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ private void SetFontSources()
{
// fontPaths accumulates font file paths obtained from the registry and the file system
// This collection is a set, i.e. only keys matter, not values.
Dictionary<string, object> fontPaths = new Dictionary<string, object>(512, StringComparer.OrdinalIgnoreCase);
HashSet<string> fontPaths = new HashSet<string>(512, StringComparer.OrdinalIgnoreCase);

using (RegistryKey fontsKey = Registry.LocalMachine.OpenSubKey(InstalledWindowsFontsRegistryKey))
{
Expand All @@ -154,16 +154,14 @@ private void SetFontSources()
if (Path.GetFileName(fileName) == fileName)
fileName = Path.Combine(Util.WindowsFontsLocalPath, fileName);

fontPaths[fileName] = null;
fontPaths.Add(fileName);
}
}
}

foreach (string file in Directory.GetFiles(_uri.LocalPath))
{
fontPaths[file] = null;
}
files = fontPaths.Keys;
fontPaths.UnionWith(Directory.EnumerateFiles(_uri.LocalPath));

files = fontPaths;
}
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1917,7 +1917,7 @@ class ProcessContentSet
bool _all;
string _namespaceName;
XmlCompatibilityReader _reader;
Dictionary<string, object> _names;
HashSet<string> _names;

public ProcessContentSet(string namespaceName, XmlCompatibilityReader reader)
{
Expand All @@ -1927,7 +1927,7 @@ public ProcessContentSet(string namespaceName, XmlCompatibilityReader reader)

public bool ShouldProcessContent(string elementName)
{
return _all || (_names != null && _names.ContainsKey(elementName));
return _all || (_names != null && _names.Contains(elementName));
}

public void Add(string elementName)
Expand Down Expand Up @@ -1959,10 +1959,10 @@ public void Add(string elementName)
{
if (_names == null)
{
_names = new Dictionary<string, object>();
_names = new HashSet<string>();
}

_names[elementName] = null; // we don't care about value, just key
_names.Add(elementName);
}
}
}
Expand Down