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

Replace LinkedList by ArrayList and or List #268

Merged
merged 2 commits into from
Feb 19, 2020

Conversation

jpbempel
Copy link
Member

LinkedList are heavier regarding memory footprint, we prefer to void
its usage by just replacing by ArrayList.
I have changed also the type to use List interface as it will be
easier to change implementation if required.
Some lists are also pre-sized when possible.

LinkedList are heavier regarding memory footprint, we prefer to void
its usage by just replacing by ArrayList.
I have changed also the type to use List interface as it will be
easier to change implementation if required.
Some lists are also pre-sized when possible.
@jpbempel jpbempel requested a review from a team February 12, 2020 14:53
}
return Collections.singletonList((String) toCast);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just want to make sure the result of this call is not expected to be modified anywhere. I see one assignment to a instance variable this.excludeTags

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, there is some add operations on it afterward

@truthbk truthbk added this to the 0.35.0 milestone Feb 18, 2020
@@ -116,7 +115,7 @@ private void addAdditionalTags() {
if (include != null) {
for (Map.Entry<String, String> tag : include.getAdditionalTags().entrySet()) {
String alias = this.replaceByAlias(tag.getValue());
if ((alias.trim().length() > 0) && alias != null) {
if (alias != null && alias.trim().length() > 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍰

@jpbempel jpbempel merged commit 69c0f53 into DataDog:master Feb 19, 2020
@jpbempel jpbempel deleted the jpbempel/replaceLinkedList branch February 19, 2020 07:45
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

Successfully merging this pull request may close these issues.

3 participants