You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2021/03/04 13:01:17 UTC

[ignite-3] branch ignite-14198 updated: IGNITE-14198 Removed lexicographic comparator.

This is an automated email from the ASF dual-hosted git repository.

agura pushed a commit to branch ignite-14198
in repository https://gitbox.apache.org/repos/asf/ignite-3.git


The following commit(s) were added to refs/heads/ignite-14198 by this push:
     new d567d36  IGNITE-14198 Removed lexicographic comparator.
d567d36 is described below

commit d567d3675f27407f8ecb560236c0caae37e97e8a
Author: Andrey Gura <ag...@apache.org>
AuthorDate: Thu Mar 4 16:00:58 2021 +0300

    IGNITE-14198 Removed lexicographic comparator.
---
 .../common/LexicographicComparator.java            | 46 ----------------------
 1 file changed, 46 deletions(-)

diff --git a/modules/metastorage-common/src/main/java/org/apache/ignite/metastorage/common/LexicographicComparator.java b/modules/metastorage-common/src/main/java/org/apache/ignite/metastorage/common/LexicographicComparator.java
deleted file mode 100644
index c0e5f9d..0000000
--- a/modules/metastorage-common/src/main/java/org/apache/ignite/metastorage/common/LexicographicComparator.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.ignite.metastorage.common;
-
-import java.util.Comparator;
-
-/**
- * Byte array lexicographic comparator.
- */
-public class LexicographicComparator implements Comparator<byte[]> {
-    /** Comparator instance. */
-    public static final Comparator<byte[]> INSTANCE = new LexicographicComparator();
-
-    /** {@inheritDoc} */
-    @Override public int compare(byte[] o1, byte[] o2) {
-        int minLength = Math.min(o1.length, o2.length);
-
-        for (int i = 0; i < minLength; ++i) {
-            int res = toInt(o1[i]) - toInt(o2[i]);
-
-            if (res != 0)
-                return res;
-        }
-
-        return o1.length - o2.length;
-    }
-
-    private static int toInt(byte val) {
-        return val & 0xFF;
-    }
-}