Skip to content

Commit

Permalink
Optimize code and get rid of deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
ThexXTURBOXx committed Feb 18, 2024
1 parent 6d462cf commit 55c5df7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -656,11 +656,7 @@ protected void print(final Object cst) {
}

protected void print(final Label l) {
String name = labelNames.get(l);
if (name == null) {
name = "L" + labelNames.size();
labelNames.put(l, name);
}
String name = labelNames.computeIfAbsent(l, k -> "L" + labelNames.size());
pw.print(name);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class BadZipEntryFlagTest {
public void test1() throws IOException {
ZipArchiveInputStream zis = new ZipArchiveInputStream(BadZipEntryFlagTest.class.getResourceAsStream("/bad"
+ ".zip"));
for (ZipArchiveEntry e = zis.getNextZipEntry(); e != null; e = zis.getNextZipEntry()) {
for (ZipArchiveEntry e = zis.getNextEntry(); e != null; e = zis.getNextEntry()) {
e.getGeneralPurposeBit().useEncryption(false);
if (!e.isDirectory()) {
zis.read();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -657,11 +657,7 @@ private void genSwitchMethod(ClassVisitor cw, String typeName, String methodName
for (int i = 0; i < labels.length; i++) {
Callback cb = callbacks.get(i);
String key = callback.getKey((MtdInfo) cb.target);
Label label = strMap.get(key);
if (label == null) {
label = new Label();
strMap.put(key, label);
}
Label label = strMap.computeIfAbsent(key, k -> new Label());
labels[i] = label;
}

Expand Down

0 comments on commit 55c5df7

Please sign in to comment.