Re: groovy git commit: Increase the possible size of value in GString instance

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: groovy git commit: Increase the possible size of value in GString instance

Jochen Theodorou
On 25.01.2018 07:32, [hidden email] 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

Reply | Threaded
Open this post in threaded view
|

Re: groovy git commit: Increase the possible size of value in GString instance

Daniel Sun
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
MG
Reply | Threaded
Open this post in threaded view
|

Re: groovy git commit: Increase the possible size of value in GString instance

MG
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
>