Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a99231d

Browse files
author
Ram swaroop
committed
code shortened/improved
1 parent 47dbe81 commit a99231d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/me/ramswaroop/bits/SubBit.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ public class SubBit {
1919
* @return
2020
*/
2121
public static int getSubBits(int num, int start, int end) {
22-
num = num << (32 - end) >>> (start - end + 31); // more intuitive (start - 1 + 32 - end)
23-
return num;
22+
return num << (32 - end) >>> (start - end + 31); // more intuitive (start - 1 + 32 - end)
2423
}
2524

2625
public static void main(String a[]) {

0 commit comments

Comments
 (0)