diff --git a/modules/android/serialization/src/main/java/com/tencent/mtt/hippy/serialization/nio/writer/SafeHeapWriter.java b/modules/android/serialization/src/main/java/com/tencent/mtt/hippy/serialization/nio/writer/SafeHeapWriter.java index b30b18a7237..7d08fe8b402 100644 --- a/modules/android/serialization/src/main/java/com/tencent/mtt/hippy/serialization/nio/writer/SafeHeapWriter.java +++ b/modules/android/serialization/src/main/java/com/tencent/mtt/hippy/serialization/nio/writer/SafeHeapWriter.java @@ -83,20 +83,29 @@ public int putVarint(long l) { if (count + 10 > value.length) { enlargeBuffer(count + 10); } - LogUtils.d("CallFunction", "putVarint l " + l + ", count " + count); + if (LogUtils.isDebugMode()) { + LogUtils.d("CallFunction", "putVarint l " + l + ", count " + count); + } long rest = l; int bytes = 0; byte b; do { b = (byte) rest; - LogUtils.d("CallFunction", "putVarint origin b " + b + ", count " + count); + if (LogUtils.isDebugMode()) { + LogUtils.d("CallFunction", "putVarint origin b " + b + ", count " + count); + } b |= 0x80; - LogUtils.d("CallFunction", "putVarint b " + Byte.toUnsignedInt(b) + ", count " + count); + if (LogUtils.isDebugMode()) { + LogUtils.d("CallFunction", "putVarint b " + Byte.toUnsignedInt(b) + ", count " + count); + } value[count++] = b; rest >>>= 7; bytes++; } while (rest != 0); - LogUtils.d("CallFunction", "putVarint bb " + Byte.toUnsignedInt((byte) (b & 0x7f)) + ", bytes " + bytes + ", count " + count); + if (LogUtils.isDebugMode()) { + LogUtils.d("CallFunction", + "putVarint bb " + Byte.toUnsignedInt((byte) (b & 0x7f)) + ", bytes " + bytes + ", count " + count); + } value[count - 1] = (byte) (b & 0x7f); return bytes; }