-
Notifications
You must be signed in to change notification settings - Fork 75
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
and/or between filters #1733
Open
Prahitha
wants to merge
7
commits into
chipsalliance:master
Choose a base branch
from
Prahitha:filter-ui
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
and/or between filters #1733
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
94266c3
and/or between filters
Prahitha e578874
fixed var b/w coverage
Prahitha 21f4911
fixed some bugs; or filtering
Prahitha 689f2c9
modified search function
Prahitha ab8abfc
optimizing search (eval)
Prahitha 01dd11d
ui fix (onchange filter type)
Prahitha 856b5ed
move filters to the right
Prahitha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm missing something here. When I print
result
in the console it shows(coverage, tool, types) => (true/false)
. I believe this is supposed to only return a boolean though. So, I was wondering what I was doing wrong and wanted some help. Thank you!There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's break it:
the last line is effectively the same as:
So this returns a function and the console prints its code.
(Spoiler alert: hints/solutions for further steps ahead ;) )
As a side note:
I guess
filter_expression
is a string with javascript expression code that usescoverage
,tool
,types
variables. If so, you actually only need this inner eval (filter_result
) to get result of the expression.However, the whole function code looks like you want to actually generate a
filter_cell
function - in this case:eval
.filter_result
value, you should use the expression string (filter_expression
) itself in the string concatenation.filter_result
doesn't need any of its arguments (or, for readability purposes, could takefilter_expression
string as an argument). More suitable name for the function would be something likecompile_filter_cell_function
. It should be used this way:var filter_cell = compile_filter_cell_function(filter_expression)
.The difference between two solutions (using the function that does eval of the expression vs compiling this function) is performance -
filter_cell
will be called on a few hundred (thousand?) cells in a loop, so it's better to runeval
once instead of running it for every cell.