what-the-bank/sources/com/google/firebase/crashlytics/internal/stacktrace/MiddleOutStrategy.java

26 lines
997 B
Java

package com.google.firebase.crashlytics.internal.stacktrace;
/* loaded from: classes2.dex */
public class MiddleOutStrategy implements StackTraceTrimmingStrategy {
private final int trimmedSize;
public MiddleOutStrategy(int i) {
this.trimmedSize = i;
}
@Override // com.google.firebase.crashlytics.internal.stacktrace.StackTraceTrimmingStrategy
public StackTraceElement[] getTrimmedStackTrace(StackTraceElement[] stackTraceElementArr) {
int length = stackTraceElementArr.length;
int i = this.trimmedSize;
if (length <= i) {
return stackTraceElementArr;
}
int i2 = i / 2;
int i3 = i - i2;
StackTraceElement[] stackTraceElementArr2 = new StackTraceElement[i];
System.arraycopy(stackTraceElementArr, 0, stackTraceElementArr2, 0, i3);
System.arraycopy(stackTraceElementArr, stackTraceElementArr.length - i2, stackTraceElementArr2, i3, i2);
return stackTraceElementArr2;
}
}