-
Notifications
You must be signed in to change notification settings - Fork 599
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
Add and Replace SLASH and ROOT constants #2256
Add and Replace SLASH and ROOT constants #2256
Conversation
@@ -9,7 +9,7 @@ | |||
module NewRelic | |||
module Agent | |||
class RulesEngine | |||
SEGMENT_SEPARATOR = '/'.freeze | |||
SEGMENT_SEPARATOR = NewRelic::SLASH |
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 assigned the SLASH
to SEGMENT_SEPARATOR
because I felt, the SEGMENT_SEPARATOR
is the best name for the context for SLASH
here. Please let me know if you think otherwise.
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.
Having one constant reference another gives us the benefit of using a more context-specific name while still minimizing resources and not* maintaining two copies of the same frozen string. I really like your approach here, @chahmedejaz.
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.
Thank you very much for your contribution, @chahmedejaz! I'll let the automated unit tests run and as long as they pass with the changes, we'll get this one merged. These changes will provide improved performance for customers and are appreciated!
@@ -9,7 +9,7 @@ | |||
module NewRelic | |||
module Agent | |||
class RulesEngine | |||
SEGMENT_SEPARATOR = '/'.freeze | |||
SEGMENT_SEPARATOR = NewRelic::SLASH |
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.
Having one constant reference another gives us the benefit of using a more context-specific name while still minimizing resources and not* maintaining two copies of the same frozen string. I really like your approach here, @chahmedejaz.
It was a pleasure working on this. Thanks for giving me the opportunity! 😄 |
Overview
/
) constant because I felt that we are using it in the path's context in many places as wellSubmitter Checklist:
Resolves #2153