Skip to content

Avoid unnecessary calls to String copy constructor#14

Merged
Suraiya-Hameed merged 2 commits intomicrosoft:devfrom
marschall:String-copy-constructor
Dec 1, 2016
Merged

Avoid unnecessary calls to String copy constructor#14
Suraiya-Hameed merged 2 commits intomicrosoft:devfrom
marschall:String-copy-constructor

Conversation

@marschall
Copy link
Copy Markdown
Contributor

The driver currently contains 20 calls to the String(String) copy
constructor. To quote from the Javadoc

Unless an explicit copy of {@code original} is needed, use of this
constructor is unnecessary since Strings are immutable.

Calling the constructor only results in unnecessary pressure of both
the allocator and the heap.

The driver currently contains 20 calls to the String(String) copy
constructor. To quote from the Javadoc

> Unless an explicit copy of {@code original} is needed, use of this
> constructor is unnecessary since Strings are immutable.

Calling the constructor only results in unnecessary pressure of both
the allocator and the heap.
@YoungGah YoungGah added Under Review Used for pull requests under review under testing labels Nov 22, 2016
Copy link
Copy Markdown

@YoungGah YoungGah left a comment

Choose a reason for hiding this comment

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

Looks good

…ring-copy-constructor

# Conflicts:
#	src/main/java/com/microsoft/sqlserver/jdbc/IOBuffer.java
#	src/main/java/com/microsoft/sqlserver/jdbc/dtv.java
@Suraiya-Hameed Suraiya-Hameed merged commit ab18af1 into microsoft:dev Dec 1, 2016
@Suraiya-Hameed
Copy link
Copy Markdown
Contributor

Thanks for your contribution @marschall

rene-ye added a commit that referenced this pull request Mar 6, 2018
lilgreenbird pushed a commit to lilgreenbird/mssql-jdbc that referenced this pull request Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Under Review Used for pull requests under review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants