Skip to content

Commit

Permalink
remove code unnecessary for functions
Browse files Browse the repository at this point in the history
  • Loading branch information
bananaturtlesandwich committed Jan 16, 2025
1 parent 9fa0291 commit dd68c7c
Showing 1 changed file with 4 additions and 29 deletions.
33 changes: 4 additions & 29 deletions src/transplant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,8 @@ pub fn transplant<C: std::io::Seek + std::io::Read, D: std::io::Seek + std::io::
&import.class_name,
&import.object_name,
) {
// sometimes e.g for GEN_VARIABLEs you want those imports
Some(existing)
if donor.get_import(import.outer_index).is_some_and(|imp| {
recipient
.get_import(PackageIndex::new(existing))
.is_some_and(|import| {
imp.class_package.eq_content(&import.class_package)
&& imp.class_name.eq_content(&import.class_name)
&& imp.object_name.eq_content(&import.object_name)
})
}) =>
{
existing
}
_ => {
Some(existing) => existing,
None => {
-import_offset
- match imports.iter().position(|imp: &Import| {
imp.class_package.eq_content(&import.class_package)
Expand Down Expand Up @@ -81,20 +68,8 @@ pub fn transplant<C: std::io::Seek + std::io::Read, D: std::io::Seek + std::io::
&parent.class_name,
&parent.object_name,
) {
Some(existing)
if donor.get_import(parent.outer_index).is_some_and(|imp| {
recipient
.get_import(PackageIndex::new(existing))
.is_some_and(|import| {
imp.class_package.eq_content(&import.class_package)
&& imp.class_name.eq_content(&import.class_name)
&& imp.object_name.eq_content(&import.object_name)
})
}) =>
{
existing
}
_ => {
Some(existing) => existing,
None => {
-import_offset
- match imports.iter().position(|import: &Import| {
import.class_package.eq_content(&parent.class_package)
Expand Down

0 comments on commit dd68c7c

Please sign in to comment.