aboutsummaryrefslogtreecommitdiff
path: root/src/unityfs/mod.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-03-15 15:24:25 +0100
committermetamuffin <metamuffin@disroot.org>2025-03-15 15:24:25 +0100
commitca02789996b94db87cd84571edb42bbcd9a3a18b (patch)
tree0563898f43928e877ef59ad50ea2d392e554553d /src/unityfs/mod.rs
parentd836e24357b81496c61f3cc9195ba36758523578 (diff)
downloadunity-tools-ca02789996b94db87cd84571edb42bbcd9a3a18b.tar
unity-tools-ca02789996b94db87cd84571edb42bbcd9a3a18b.tar.bz2
unity-tools-ca02789996b94db87cd84571edb42bbcd9a3a18b.tar.zst
fix inefficient multi readers
Diffstat (limited to 'src/unityfs/mod.rs')
-rw-r--r--src/unityfs/mod.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/unityfs/mod.rs b/src/unityfs/mod.rs
index bc7e3ec..16e4283 100644
--- a/src/unityfs/mod.rs
+++ b/src/unityfs/mod.rs
@@ -40,11 +40,10 @@ impl<T: Read + Seek> UnityFS<T> {
}
pub fn find_main_file(&self) -> Option<&NodeInfo> {
- self.header.nodes().iter().find(|n| {
- !n.name.ends_with(".resource")
- && !n.name.ends_with(".resS")
- && !n.name.ends_with(".sharedAssets")
- })
+ self.header
+ .nodes()
+ .iter()
+ .find(|n| n.name.split_once(".").is_none())
}
pub fn read<'a>(&'a self, node: &NodeInfo) -> Result<NodeReader<BlockReader<MultiReader<T>>>> {