On Monday, November 20, 2017 at 11:32:34 AM UTC-6, Jan Mercl wrote: > > On Mon, Nov 20, 2017 at 5:48 PM Trig <edb...@gmail.com <javascript:>> > wrote: > > > Is using append this way (to remove an index), inside of the range loop > of the same array I'm working with, safe... since the size of myList is > being changed within it? > > It's safe as it will not crash your program. It's unsafe as it's a > quadratic algorithm instead of a linear one. >
It's also unsafe in the sense that it produces incorrect results: https://play.golang.org/p/mB71A4Q9bd -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.