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

Redundant code in sa_advanced.py #10

Open
yyyayo opened this issue Jun 9, 2022 · 1 comment
Open

Redundant code in sa_advanced.py #10

yyyayo opened this issue Jun 9, 2022 · 1 comment

Comments

@yyyayo
Copy link

yyyayo commented Jun 9, 2022

Hi,

Do these codes have the same meaning? I think some of them maybe redundant.

            all_matches = []
            for x in self._checkpoint:
                all_matches += list(filter(lambda y: x in y, names))

from line 482,

            for x in checkpoints.copy():
                if x not in names:
                    checkpoints.pop(x)
            if len(checkpoints) == 0:
                # Default to function entry
                target.source = target.addr
            else:
                target.source = checkpoints

from line 512, and

            filtered_checkpoints = {}
            for x in checkpoints.copy():
                for y in names:
                    if x in y:
                        filtered_checkpoints[y] = self._checkpoint[x]

            target.source = filtered_checkpoints if len(filtered_checkpoints) > 0 else target.addr

from line 521.

@jkrshnmenon
Copy link
Owner

I agree. Especially the blocks at line 512 and 521 seem to be practically redundant.
I'm working on cleaning up the code a bit, but it might take some time.
Feel free to submit a PR though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants