You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "songwanging (JIRA)" <ji...@apache.org> on 2015/07/27 02:53:04 UTC

[jira] [Created] (PIG-4643) variables could be reused

songwanging created PIG-4643:
--------------------------------

             Summary: variables could be reused 
                 Key: PIG-4643
                 URL: https://issues.apache.org/jira/browse/PIG-4643
             Project: Pig
          Issue Type: Improvement
            Reporter: songwanging
            Priority: Trivial


In method "compareBinInterSedesDatum" of Class : pig-0.15.0\src\org\apache\pig\data\BinInterSedes.java

In this method, variables "dt1" and "dt2" could be reused, as shown below, in switch block "case BinInterSedes.BIGINTEGER", "bb1.get()" and "bb2.get()" should be reused "dt1", "dt2" as all other cases did.

 private int compareBinInterSedesDatum(ByteBuffer bb1, ByteBuffer bb2, boolean[] asc) throws IOException {
byte dt1 = bb1.get();
byte dt2 = bb2.get();
	…
   switch (dt1) { 
…
case BinInterSedes.BIGINTEGER: {
    if(...){
   int sz1 = readSize(bb1, bb1.get());
   int sz2 = readSize(bb2, bb2.get());
…
        } 
 case BinInterSedes.BYTEARRAY: {
    if(...){
   int sz1 = readSize(bb1, dt1);
   int sz2 = readSize(bb2, dt2);
…
        } 
 case BinInterSedes.CHARARRAY: {
    if(...){
   int sz1 = readSize(bb1, dt1);
   int sz2 = readSize(bb2, dt2);
…
        }
}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)