-
Notifications
You must be signed in to change notification settings - Fork 23
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
fix: duplicate DRP call #432
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Sacha Froment <[email protected]>
b6e40e3
to
b42cc8b
Compare
Co-authored-by: Sacha Froment <[email protected]>
const computeFn = isACL ? this._computeObjectACL : this._computeDRP; | ||
const vertexDependencies = this.hashGraph.getFrontier(); | ||
const preOperationDRP = computeFn(vertexDependencies); |
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.
why don't you call these functions directly instead of defining a new variable computeFn
. it just makes the code harder to understand
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 don't agree with this statement, but we can still discuss about it
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.
it remove and if else and also remove the fact that we have to add a let var
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.
this way is more js idiomatic, in js the more you are functional the better it is .
Overall the less mutation you have the better, also the more reliability and readability you'll have
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 mean:
const preOperationDRP = isACL ? this._computeObjectACL(vertexDependencies) : this._computeDRP(vertexDependencies);
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.
Oh yes 👍!
const appliedOperationResult = obj.callFn(fullPropKey, args, vertexType); | ||
return appliedOperationResult; |
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.
const appliedOperationResult = obj.callFn(fullPropKey, args, vertexType); | |
return appliedOperationResult; | |
return obj.callFn(fullPropKey, args, vertexType); |
Resolved: #404