Skip to content

Commit 7bf42b3

Browse files
committed
optimize
1 parent 2bedb1a commit 7bf42b3

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/java/com/reandroid/arsc/array/SparseOffsetsArray.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public int getOffset(int i){
6666
if(value == NO_ENTRY){
6767
return value;
6868
}
69-
value = (value >>> 16) & 0xffff;
69+
value = value >>> 16;
7070
return value * 4;
7171
}
7272
@Override
@@ -77,9 +77,7 @@ public void setOffset(int index, int offset){
7777
}else {
7878
int idx = get(index);
7979
idx = idx & 0xffff;
80-
offset = offset & 0xffff;
81-
offset = offset / 4;
82-
offset = offset << 16;
80+
offset = (offset >>> 2) << 18;
8381
value = offset | idx;
8482
}
8583
super.put(index, value);

0 commit comments

Comments
 (0)