From 20b7bbf63e7c689316b8fbc28ecd1212ab4fe6b9 Mon Sep 17 00:00:00 2001 From: Jeff Smith Date: Tue, 19 Nov 2013 08:46:11 -0600 Subject: [PATCH] baksmali: Only perform resource ID lookup once --- .../jf/baksmali/Adaptors/Format/InstructionMethodItem.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/baksmali/src/main/java/org/jf/baksmali/Adaptors/Format/InstructionMethodItem.java b/baksmali/src/main/java/org/jf/baksmali/Adaptors/Format/InstructionMethodItem.java index fd2cf4b6..e0a969cc 100644 --- a/baksmali/src/main/java/org/jf/baksmali/Adaptors/Format/InstructionMethodItem.java +++ b/baksmali/src/main/java/org/jf/baksmali/Adaptors/Format/InstructionMethodItem.java @@ -346,9 +346,10 @@ public class InstructionMethodItem extends MethodItem { protected void writeResourceId(IndentingWriter writer, int val) throws IOException { Map resourceIds = methodDef.classDef.options.resourceIds; - if (resourceIds.containsKey(Integer.valueOf(val))) { + String resource = resourceIds.get(Integer.valueOf(val)); + if (resource != null) { writer.write(" # "); - writer.write(resourceIds.get(Integer.valueOf(val))); + writer.write(resource); } }