Libraryless. Click here for Pure Java version (32L/1K).
1 | svoid shrinkStringBufferIf50PercentSlack(StringBuffer buf) { |
2 | if (buf == null) ret; |
3 | synchronized(buf) { |
4 | if (buf.capacity() >= buf.length()*2) |
5 | buf.trimToSize(); |
6 | } |
7 | } |
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1024228 |
Snippet name: | shrinkStringBufferIf50PercentSlack |
Eternal ID of this version: | #1024228/1 |
Text MD5: | 7673852655bb58d6bd8ea3cc3d97d1f0 |
Transpilation MD5: | 1781337a397eb0f18ce220dc915a5540 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-07-28 13:40:14 |
Source code size: | 184 bytes / 7 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 195 / 286 |
Referenced in: | [show references] |