Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal backend optimizations #31

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions Sources/Orion/InternalBackend.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,8 @@

let imp = IMP(replacement)
let orig: IMP
// first try to add the method (in case the current imp is inherited)
if class_addMethod(cls, sel, imp, types) {
// if added, return the super imp
orig = method_getImplementation(origMethod)
} else {
// otherwise, the current class has its own imp of the method. Replace it.
orig = method_setImplementation(origMethod, imp)
}
// class_replaceMethod adds the method if it's implemented by the superclass so no need to replicate this behavior
orig = class_replaceMethod(cls, sel, imp, types);

Check warning on line 42 in Sources/Orion/InternalBackend.swift

View workflow job for this annotation

GitHub Actions / lint

Trailing Semicolon Violation: Lines should not have trailing semicolons (trailing_semicolon)

return .init(orig)
}
Expand Down
Loading