You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ki...@apache.org on 2021/11/10 18:10:36 UTC

[pinot] branch master updated: remove unused Number2ObjectPair class and auxiliaries (#7736)

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

kishoreg pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new b66643a  remove unused Number2ObjectPair class and auxiliaries (#7736)
b66643a is described below

commit b66643aa671c8b21b6e6320b25fed1a03e15d1fc
Author: Richard Startin <ri...@startree.ai>
AuthorDate: Wed Nov 10 18:10:14 2021 +0000

    remove unused Number2ObjectPair class and auxiliaries (#7736)
---
 .../java/org/apache/pinot/spi/utils/Pairs.java     | 44 +---------------------
 1 file changed, 2 insertions(+), 42 deletions(-)

diff --git a/pinot-spi/src/main/java/org/apache/pinot/spi/utils/Pairs.java b/pinot-spi/src/main/java/org/apache/pinot/spi/utils/Pairs.java
index d3e8a11..be18d35 100644
--- a/pinot-spi/src/main/java/org/apache/pinot/spi/utils/Pairs.java
+++ b/pinot-spi/src/main/java/org/apache/pinot/spi/utils/Pairs.java
@@ -90,46 +90,6 @@ public class Pairs {
     }
   }
 
-  public static Comparator<Number2ObjectPair> getAscendingnumber2ObjectPairComparator() {
-    return new AscendingNumber2ObjectPairComparator();
-  }
-
-  public static Comparator<Number2ObjectPair> getDescendingnumber2ObjectPairComparator() {
-    return new DescendingNumber2ObjectPairComparator();
-  }
-
-  public static class Number2ObjectPair<T> {
-    Number _a;
-    T _b;
-
-    public Number2ObjectPair(Number a, T b) {
-      _a = a;
-      _b = b;
-    }
-
-    public Number getA() {
-      return _a;
-    }
-
-    public T getB() {
-      return _b;
-    }
-  }
-
-  public static class AscendingNumber2ObjectPairComparator implements Comparator<Number2ObjectPair> {
-    @Override
-    public int compare(Number2ObjectPair o1, Number2ObjectPair o2) {
-      return new Double(o1._a.doubleValue()).compareTo(new Double(o2._a.doubleValue()));
-    }
-  }
-
-  public static class DescendingNumber2ObjectPairComparator implements Comparator<Number2ObjectPair> {
-    @Override
-    public int compare(Number2ObjectPair o1, Number2ObjectPair o2) {
-      return new Double(o2._a.doubleValue()).compareTo(new Double(o1._a.doubleValue()));
-    }
-  }
-
   /**
    * Utility class to store a primitive 'int' and 'double' pair.
    */
@@ -273,9 +233,9 @@ public class Pairs {
       Comparable c2 = (Comparable) pair2.getObjectValue();
 
       int cmpValue = c1.compareTo(c2);
-      if (cmpValue == -1) {
+      if (cmpValue < 0) {
         return (_descending) ? 1 : -1;
-      } else if (cmpValue == 1) {
+      } else if (cmpValue > 0) {
         return (_descending) ? -1 : 1;
       } else {
         return 0;

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org