You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "dk2k (via GitHub)" <gi...@apache.org> on 2023/04/04 15:16:08 UTC

[GitHub] [camel] dk2k opened a new pull request, #9805: Fixed concatenations with empty string

dk2k opened a new pull request, #9805:
URL: https://github.com/apache/camel/pull/9805

   Fixed concatenations with empty string - substituted with <Type>.toString() or String.valueOf()
   
   Concatenation with an empty string provides for 'plus' operation string context. It means, that numeric types are interpreted as strings by calling String.valueOf(). If you take a look at String.valueOf(int), String.valueOf(long) or String.valueOf(double), you can see it's redirected to Integer.toString(), Long.toString() and Double.toString(). So, sometimes I save a stack frame avoiding a call.
   Another aspect. 
   "" + long1 
   most likely will be translated to
   new StringBuilder().append(String.valueOf(long1)); 
   or
   new StringBuilder().append(mew Long(long1).toString()); 
   Hence, I can avoid creation of this temporal StringBuilder and probably of Long.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #9805: Fixed concatenations with empty string

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9805:
URL: https://github.com/apache/camel/pull/9805#issuecomment-1496328253

   ### Components tested:
   
   | Total | Tested | Failed :x: | Passed :white_check_mark: | 
   | --- | --- | --- |  --- |
   | 9 | 9 | 0 | 10 |


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #9805: Fixed concatenations with empty string

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #9805:
URL: https://github.com/apache/camel/pull/9805#issuecomment-1496164575

   :star2: Thank you for your contribution to the Apache Camel project! :star2: 
   
   :warning: Please note that the changes on this PR may be **tested automatically**. 
   
   If necessary Apache Camel Committers may access logs and test results in the job summaries!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] davsclaus merged pull request #9805: Fixed concatenations with empty string

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #9805:
URL: https://github.com/apache/camel/pull/9805


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org