Fix unnecessary bitwise operations

This commit is contained in:
Nelson A. de Oliveira 2013-07-31 15:39:50 -03:00
parent ffaaef6610
commit a525df7694
5 changed files with 5 additions and 5 deletions

View file

@ -72,6 +72,6 @@ public class GeoidAltitudeCorrection {
rf.read(b); rf.read(b);
int ch1 = b[0] < 0 ? b[0] + 256 : b[0]; int ch1 = b[0] < 0 ? b[0] + 256 : b[0];
int ch2 = b[1] < 0 ? b[1] + 256 : b[1]; int ch2 = b[1] < 0 ? b[1] + 256 : b[1];
return (short)((ch1 << 8) + (ch2 << 0)); return (short)((ch1 << 8) + ch2);
} }
} }

View file

@ -190,7 +190,7 @@ public class BinaryInspector {
ous.writeRawByte((v >>> 24) & 0xFF); ous.writeRawByte((v >>> 24) & 0xFF);
ous.writeRawByte((v >>> 16) & 0xFF); ous.writeRawByte((v >>> 16) & 0xFF);
ous.writeRawByte((v >>> 8) & 0xFF); ous.writeRawByte((v >>> 8) & 0xFF);
ous.writeRawByte((v >>> 0) & 0xFF); ous.writeRawByte(v & 0xFF);
//written += 4; //written += 4;
} }

View file

@ -339,7 +339,7 @@ public class BinaryMapIndexReader {
int ch2 = readByte(); int ch2 = readByte();
int ch3 = readByte(); int ch3 = readByte();
int ch4 = readByte(); int ch4 = readByte();
return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0)); return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + ch4);
} }

View file

@ -47,7 +47,7 @@ public class Base64 {
// store the octets // store the octets
bits24 = (octetString[i++] & 0xFF) << 16; bits24 = (octetString[i++] & 0xFF) << 16;
bits24 |= (octetString[i++] & 0xFF) << 8; bits24 |= (octetString[i++] & 0xFF) << 8;
bits24 |= (octetString[i++] & 0xFF) << 0; bits24 |= (octetString[i++] & 0xFF);
bits6 = (bits24 & 0x00FC0000) >> 18; bits6 = (bits24 & 0x00FC0000) >> 18;
out[outIndex++] = alphabet[bits6]; out[outIndex++] = alphabet[bits6];

View file

@ -54,7 +54,7 @@ public class Algorithms {
int ch4 = in.read(); int ch4 = in.read();
if ((ch1 | ch2 | ch3 | ch4) < 0) if ((ch1 | ch2 | ch3 | ch4) < 0)
throw new EOFException(); throw new EOFException();
return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0)); return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + ch4);
} }
public static String capitalizeFirstLetterAndLowercase(String s) { public static String capitalizeFirstLetterAndLowercase(String s) {