You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2017/01/29 13:27:46 UTC
[24/37] lucenenet git commit: Lucene.Net.Codecs: Removed unnecessary
HashMapHelperClass
Lucene.Net.Codecs: Removed unnecessary HashMapHelperClass
Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/87a256e9
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/87a256e9
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/87a256e9
Branch: refs/heads/api-work
Commit: 87a256e9f88d0e1811fb464c34623facdcbff9bb
Parents: 5524a91
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Sun Jan 29 16:34:03 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Sun Jan 29 17:10:25 2017 +0700
----------------------------------------------------------------------
src/Lucene.Net.Codecs/HashMapHelperClass.cs | 28 --------------------
src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj | 1 -
.../Memory/DirectPostingsFormat.cs | 2 +-
3 files changed, 1 insertion(+), 30 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/87a256e9/src/Lucene.Net.Codecs/HashMapHelperClass.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/HashMapHelperClass.cs b/src/Lucene.Net.Codecs/HashMapHelperClass.cs
deleted file mode 100644
index b5caf41..0000000
--- a/src/Lucene.Net.Codecs/HashMapHelperClass.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-\ufeff//---------------------------------------------------------------------------------------------------------
-// Copyright � 2007 - 2014 Tangible Software Solutions Inc.
-// This class can be used by anyone provided that the copyright notice remains intact.
-//
-// This class is used to replace calls to some Java HashMap or Hashtable methods.
-//---------------------------------------------------------------------------------------------------------
-using System.Collections.Generic;
-
-// LUCENENET TODO: Remove this class
-internal static class HashMapHelperClass
-{
- internal static HashSet<KeyValuePair<TKey, TValue>> SetOfKeyValuePairs<TKey, TValue>(this IDictionary<TKey, TValue> dictionary)
- {
- HashSet<KeyValuePair<TKey, TValue>> entries = new HashSet<KeyValuePair<TKey, TValue>>();
- foreach (KeyValuePair<TKey, TValue> keyValuePair in dictionary)
- {
- entries.Add(keyValuePair);
- }
- return entries;
- }
-
- internal static TValue GetValueOrNull<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key)
- {
- TValue ret;
- dictionary.TryGetValue(key, out ret);
- return ret;
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/87a256e9/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj b/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj
index a0e850b..aff960b 100644
--- a/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj
+++ b/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj
@@ -61,7 +61,6 @@
<Compile Include="DiskDV\DiskDocValuesFormat.cs" />
<Compile Include="DiskDV\DiskDocValuesProducer.cs" />
<Compile Include="DiskDV\DiskNormsFormat.cs" />
- <Compile Include="HashMapHelperClass.cs" />
<Compile Include="IntBlock\FixedIntBlockIndexInput.cs" />
<Compile Include="IntBlock\FixedIntBlockIndexOutput.cs" />
<Compile Include="IntBlock\VariableIntBlockIndexInput.cs" />
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/87a256e9/src/Lucene.Net.Codecs/Memory/DirectPostingsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Memory/DirectPostingsFormat.cs b/src/Lucene.Net.Codecs/Memory/DirectPostingsFormat.cs
index ff4a327..347891c 100644
--- a/src/Lucene.Net.Codecs/Memory/DirectPostingsFormat.cs
+++ b/src/Lucene.Net.Codecs/Memory/DirectPostingsFormat.cs
@@ -174,7 +174,7 @@ namespace Lucene.Net.Codecs.Memory
public override long RamBytesUsed()
{
long sizeInBytes = 0;
- foreach (KeyValuePair<string, DirectField> entry in fields.SetOfKeyValuePairs())
+ foreach (KeyValuePair<string, DirectField> entry in fields)
{
sizeInBytes += entry.Key.Length*RamUsageEstimator.NUM_BYTES_CHAR;
sizeInBytes += entry.Value.RamBytesUsed();