mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-25 09:56:27 +00:00
faster searchTreeItem
This commit is contained in:
@@ -19,6 +19,8 @@ package com.jpexs.decompiler.flash.timeline;
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.tags.base.ASMSource;
|
||||
import com.jpexs.decompiler.flash.treeitems.TreeItem;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
@@ -49,6 +51,13 @@ public class AS2Package implements TreeItem {
|
||||
return swf;
|
||||
}
|
||||
|
||||
public List<TreeItem> getAllChildren() {
|
||||
List<TreeItem> result = new ArrayList<>(getChildCount());
|
||||
result.addAll(subPackages.values());
|
||||
result.addAll(scripts.values());
|
||||
return result;
|
||||
}
|
||||
|
||||
public TreeItem getChild(int index) {
|
||||
if (index < subPackages.size()) {
|
||||
for (AS2Package subPackage : subPackages.values()) {
|
||||
|
||||
@@ -19,6 +19,8 @@ package com.jpexs.decompiler.flash.timeline;
|
||||
import com.jpexs.decompiler.flash.SWF;
|
||||
import com.jpexs.decompiler.flash.abc.ScriptPack;
|
||||
import com.jpexs.decompiler.flash.treeitems.AS3ClassTreeItem;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
@@ -47,6 +49,13 @@ public class AS3Package extends AS3ClassTreeItem {
|
||||
return swf;
|
||||
}
|
||||
|
||||
public List<AS3ClassTreeItem> getAllChildren() {
|
||||
List<AS3ClassTreeItem> result = new ArrayList<>(getChildCount());
|
||||
result.addAll(subPackages.values());
|
||||
result.addAll(scripts.values());
|
||||
return result;
|
||||
}
|
||||
|
||||
public AS3ClassTreeItem getChild(int index) {
|
||||
if (index < subPackages.size()) {
|
||||
for (AS3Package subPackage : subPackages.values()) {
|
||||
|
||||
@@ -96,7 +96,7 @@ public class Timeline {
|
||||
}
|
||||
}
|
||||
|
||||
public Iterable<Frame> getFrames() {
|
||||
public List<Frame> getFrames() {
|
||||
ensureInitialized();
|
||||
return frames;
|
||||
}
|
||||
|
||||
@@ -1103,7 +1103,7 @@ public class Helper {
|
||||
private static int findRight(int[] imgData, int x, int y, int width) {
|
||||
int result = x;
|
||||
int idx = width * y + x;
|
||||
while ((imgData[idx] >>> 24) > 0 && result < width) {
|
||||
while (result < width && (imgData[idx] >>> 24) > 0) {
|
||||
result++;
|
||||
idx++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user