You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@groovy.apache.org by Jochen Theodorou <bl...@gmx.org> on 2018/01/25 22:06:59 UTC
Re: groovy git commit: Increase the possible size of value in GString
instance
On 25.01.2018 07:32, sunlan@apache.org wrote:
> Repository: groovy
> Updated Branches:
> refs/heads/master 031fc238f -> 7be5f2f82
>
>
> Increase the possible size of value in GString instance
[...]
> - initialCapacity += values.length * Math.max(initialCapacity / strings.length, 1);
> + initialCapacity += values.length * Math.max(initialCapacity / strings.length, 8);
>
> return Math.max((int) (initialCapacity * 1.2), 16);
> }
I would wish here for a comment or at least a commit message why this
metric has been chosen. Otherwise the next change may very well undo
this again and nobody is really more wise here.
bye Jochen
Re: groovy git commit: Increase the possible size of value in GString
instance
Posted by MG <mg...@arscreat.com>.
Hi Daniel,
as far as I read Jochen's mail, it was not the rationale that was
challenged per se, but the lack of expressing such in the form of a
comment in the code... :-)
Cheers,
mg
On 26.01.2018 01:21, Daniel Sun wrote:
> Hi Jochen,
>
> Let's have a look at some normal examples:
>
> `println "Hello, ${name}"` // length of "Jochen" is 6, length of "Daniel" is
> 6 too
> `println "Path: ${path}"` // the length of some file location is usually
> more than 8, e.g. D:\workspace\groovy
> ```
> <html>
> <body>
> ${includedBody} // the length of html body is usually more than 8 too
> </body>
> </html>
> ```
>
> So I think the original possible size(i.e. 1) of value is too small
> ;-)
>
> Cheers,
> Daniel.Sun
>
>
>
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
>
Re: groovy git commit: Increase the possible size of value in
GString instance
Posted by Daniel Sun <re...@hotmail.com>.
Hi Jochen,
Let's have a look at some normal examples:
`println "Hello, ${name}"` // length of "Jochen" is 6, length of "Daniel" is
6 too
`println "Path: ${path}"` // the length of some file location is usually
more than 8, e.g. D:\workspace\groovy
```
<html>
<body>
${includedBody} // the length of html body is usually more than 8 too
</body>
</html>
```
So I think the original possible size(i.e. 1) of value is too small
;-)
Cheers,
Daniel.Sun
--
Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html