Skip to content

Commit 06b0bec

Browse files
committed
fix(android): only debug call R8 avoiding log
1 parent 4bd7bf9 commit 06b0bec

File tree

1 file changed

+13
-4
lines changed
  • modules/android/serialization/src/main/java/com/tencent/mtt/hippy/serialization/nio/writer

1 file changed

+13
-4
lines changed

modules/android/serialization/src/main/java/com/tencent/mtt/hippy/serialization/nio/writer/SafeHeapWriter.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,29 @@ public int putVarint(long l) {
8383
if (count + 10 > value.length) {
8484
enlargeBuffer(count + 10);
8585
}
86-
LogUtils.d("CallFunction", "putVarint l " + l + ", count " + count);
86+
if (LogUtils.isDebugMode()) {
87+
LogUtils.d("CallFunction", "putVarint l " + l + ", count " + count);
88+
}
8789
long rest = l;
8890
int bytes = 0;
8991
byte b;
9092
do {
9193
b = (byte) rest;
92-
LogUtils.d("CallFunction", "putVarint origin b " + b + ", count " + count);
94+
if (LogUtils.isDebugMode()) {
95+
LogUtils.d("CallFunction", "putVarint origin b " + b + ", count " + count);
96+
}
9397
b |= 0x80;
94-
LogUtils.d("CallFunction", "putVarint b " + Byte.toUnsignedInt(b) + ", count " + count);
98+
if (LogUtils.isDebugMode()) {
99+
LogUtils.d("CallFunction", "putVarint b " + Byte.toUnsignedInt(b) + ", count " + count);
100+
}
95101
value[count++] = b;
96102
rest >>>= 7;
97103
bytes++;
98104
} while (rest != 0);
99-
LogUtils.d("CallFunction", "putVarint bb " + Byte.toUnsignedInt((byte) (b & 0x7f)) + ", bytes " + bytes + ", count " + count);
105+
if (LogUtils.isDebugMode()) {
106+
LogUtils.d("CallFunction",
107+
"putVarint bb " + Byte.toUnsignedInt((byte) (b & 0x7f)) + ", bytes " + bytes + ", count " + count);
108+
}
100109
value[count - 1] = (byte) (b & 0x7f);
101110
return bytes;
102111
}

0 commit comments

Comments
 (0)