Kotlin: Simplify trapFilePathForDecl

This commit is contained in:
Ian Lynagh
2022-09-23 12:41:41 +01:00
parent 80968eef47
commit 70dae17d2f

View File

@@ -214,23 +214,17 @@ public class OdasaOutput {
trapFilePathForDecl(sym, signature));
}
private final Map<String, String> memberTrapPaths = new LinkedHashMap<String, String>();
private static final Pattern dots = Pattern.compile(".", Pattern.LITERAL);
private String trapFilePathForDecl(IrDeclaration sym, String signature) {
String binaryName = getIrDeclBinaryName(sym);
String binaryNameWithSignature = binaryName + signature;
// TODO: Reinstate this?
//if (getTrackClassOrigins())
// classId += "-" + StringDigestor.digest(sym.getSourceFileId());
String result = memberTrapPaths.get(binaryNameWithSignature);
if (result == null) {
result = CLASSES_DIR + "/" +
dots.matcher(binaryName).replaceAll("/") +
String result = CLASSES_DIR + "/" +
binaryName.replace('.', '/') +
signature +
".members" +
".trap.gz";
memberTrapPaths.put(binaryNameWithSignature, result);
}
return result;
}