cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbros...@apache.org
Subject cassandra git commit: don't clone the values() array for each component while deserializing MetadataTypes
Date Sat, 09 May 2015 01:32:39 GMT
Repository: cassandra
Updated Branches:
  refs/heads/trunk a583f70ee -> 6cb19216f


don't clone the values() array for each component while deserializing MetadataTypes


Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo
Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/6cb19216
Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/6cb19216
Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/6cb19216

Branch: refs/heads/trunk
Commit: 6cb19216f84454c521e2b99c41b517ccdfd0bb40
Parents: a583f70
Author: Dave Brosius <dbrosius@mebigfatguy.com>
Authored: Fri May 8 21:32:06 2015 -0400
Committer: Dave Brosius <dbrosius@mebigfatguy.com>
Committed: Fri May 8 21:32:06 2015 -0400

----------------------------------------------------------------------
 .../apache/cassandra/io/sstable/metadata/MetadataSerializer.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/6cb19216/src/java/org/apache/cassandra/io/sstable/metadata/MetadataSerializer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/io/sstable/metadata/MetadataSerializer.java b/src/java/org/apache/cassandra/io/sstable/metadata/MetadataSerializer.java
index 2be69ab..46fbbe2 100644
--- a/src/java/org/apache/cassandra/io/sstable/metadata/MetadataSerializer.java
+++ b/src/java/org/apache/cassandra/io/sstable/metadata/MetadataSerializer.java
@@ -108,9 +108,10 @@ public class MetadataSerializer implements IMetadataSerializer
         int numComponents = in.readInt();
         // read toc
         Map<MetadataType, Integer> toc = new HashMap<>(numComponents);
+        MetadataType[] values = MetadataType.values();
         for (int i = 0; i < numComponents; i++)
         {
-            toc.put(MetadataType.values()[in.readInt()], in.readInt());
+            toc.put(values[in.readInt()], in.readInt());
         }
         for (MetadataType type : types)
         {


Mime
View raw message