cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ble...@apache.org
Subject [2/5] cassandra git commit: Make sorting unconditional in followup to CASSANDRA-10162
Date Wed, 26 Aug 2015 13:32:06 GMT
Make sorting unconditional in followup to CASSANDRA-10162


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

Branch: refs/heads/trunk
Commit: d3691cb4c76512125e9437c2b8634275eca4c32c
Parents: 70819bf
Author: Sylvain Lebresne <sylvain@datastax.com>
Authored: Wed Aug 26 15:17:07 2015 +0200
Committer: Sylvain Lebresne <sylvain@datastax.com>
Committed: Wed Aug 26 15:17:07 2015 +0200

----------------------------------------------------------------------
 .../org/apache/cassandra/serializers/MapSerializer.java  | 11 -----------
 .../org/apache/cassandra/serializers/SetSerializer.java  |  3 +--
 2 files changed, 1 insertion(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cassandra/blob/d3691cb4/src/java/org/apache/cassandra/serializers/MapSerializer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/serializers/MapSerializer.java b/src/java/org/apache/cassandra/serializers/MapSerializer.java
index 6a6965b..a3ea415 100644
--- a/src/java/org/apache/cassandra/serializers/MapSerializer.java
+++ b/src/java/org/apache/cassandra/serializers/MapSerializer.java
@@ -56,17 +56,6 @@ public class MapSerializer<K, V> extends CollectionSerializer<Map<K,
V>>
 
     public List<ByteBuffer> serializeValues(Map<K, V> map)
     {
-        if (map instanceof SortedMap)
-        {
-            List<ByteBuffer> buffers = new ArrayList<>(map.size() * 2);
-            for (Map.Entry<K, V> entry : map.entrySet())
-            {
-                buffers.add(keys.serialize(entry.getKey()));
-                buffers.add(values.serialize(entry.getValue()));
-            }
-            return buffers;
-        }
-
         List<Pair<ByteBuffer, ByteBuffer>> pairs = new ArrayList<>(map.size());
         for (Map.Entry<K, V> entry : map.entrySet())
             pairs.add(Pair.create(keys.serialize(entry.getKey()), values.serialize(entry.getValue())));

http://git-wip-us.apache.org/repos/asf/cassandra/blob/d3691cb4/src/java/org/apache/cassandra/serializers/SetSerializer.java
----------------------------------------------------------------------
diff --git a/src/java/org/apache/cassandra/serializers/SetSerializer.java b/src/java/org/apache/cassandra/serializers/SetSerializer.java
index 167d620..5c4baa1 100644
--- a/src/java/org/apache/cassandra/serializers/SetSerializer.java
+++ b/src/java/org/apache/cassandra/serializers/SetSerializer.java
@@ -52,8 +52,7 @@ public class SetSerializer<T> extends CollectionSerializer<Set<T>>
         List<ByteBuffer> buffers = new ArrayList<>(values.size());
         for (T value : values)
             buffers.add(elements.serialize(value));
-        if (!(values instanceof SortedSet))
-            Collections.sort(buffers, comparator);
+        Collections.sort(buffers, comparator);
         return buffers;
     }
 


Mime
View raw message