You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Yang Jie (Jira)" <ji...@apache.org> on 2021/07/08 09:11:00 UTC

[jira] [Created] (SPARK-36047) Replace the handwriting compare methods with static compare methods in Java code

Yang Jie created SPARK-36047:
--------------------------------

             Summary: Replace the handwriting compare methods with static compare methods in Java code
                 Key: SPARK-36047
                 URL: https://issues.apache.org/jira/browse/SPARK-36047
             Project: Spark
          Issue Type: Improvement
          Components: Spark Core
    Affects Versions: 3.3.0
            Reporter: Yang Jie


There are some handwriting compare methods like `ShuffleInMemorySorter.SortComparator`
{code:java}
private static final class SortComparator implements Comparator<PackedRecordPointer> {
  @Override
  public int compare(PackedRecordPointer left, PackedRecordPointer right) {
    int leftId = left.getPartitionId();
    int rightId = right.getPartitionId();
    return Integer.compare(leftId, rightId);
  }
}
{code}
the handwriting compare methods can replace with `Integer.compare()` method and similar methods after Java 1.7



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org