Re: [go-nuts] Repeated functions with the same output in loops

2018-09-07 Thread Ian Lance Taylor
On Fri, Sep 7, 2018 at 1:41 AM, Sergey Kamardin wrote: >> Note that calculating the length of a slice is a fast operation; it's >> a single memory load. > > So, actually it just loads a slice header's field? Yes. Ian -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Repeated functions with the same output in loops

2018-09-07 Thread Sergey Kamardin
> Note that calculating the length of a slice is a fast operation; it's > a single memory load. So, actually it just loads a slice header's field? On Thu, 09/06/18, fff Sep 06, 2018 at 12:56:36PM -0700, Ian Lance Taylor wrote: > On Thu, Sep 6, 2018 at 12:24 PM, mustafa katipoğlu > <98mustafakatip

Re: [go-nuts] Repeated functions with the same output in loops

2018-09-06 Thread Ian Lance Taylor
On Thu, Sep 6, 2018 at 12:24 PM, mustafa katipoğlu <98mustafakatipo...@gmail.com> wrote: > > If I use len() function inside of a foor loop , does it calculates the > output each time? or if the output will be the same(like arrays) will it > calculates the length of the function again ? > > var lett

[go-nuts] Repeated functions with the same output in loops

2018-09-06 Thread mustafa katipoğlu
If I use len() function inside of a foor loop , does it calculates the output each time? or if the output will be the same(like arrays) will it calculates the length of the function again ? var letterRunes = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_") b := make([