Tell me I'm going blind...

304 views
Skip to first unread message

Nick Patavalis

unread,
Nov 16, 2014, 9:01:00 AM11/16/14
to golan...@googlegroups.com
This

  http://play.golang.org/p/pKdCV8yTZL

Prints:

  [{0 12} {1 13}] 2 2 
  [{0 12}] 1 2

But replacing the myq.Get() call with the open-coded version (commented-out above) produces:

  [{0 12} {1 13}] 2 2 
  [{1 13}] 1 2

Which is what I would expect.

I've been staring at this for an hour now... tell me I'm going blind, or I'm missing something obvious..

Thanks
/npat

Nick Patavalis

unread,
Nov 16, 2014, 9:14:02 AM11/16/14
to golan...@googlegroups.com


On Sunday, November 16, 2014 4:01:00 PM UTC+2, Nick Patavalis wrote:

I've been staring at this for an hour now... tell me I'm going blind, or I'm missing something obvious..


Ok ignore, I'm going blind after all (line 16):

  copy(q[i:], q[i+i:]) 

i+i instead of i+1

/npat

Miki Tebeka

unread,
Nov 17, 2014, 7:42:15 AM11/17/14
to golan...@googlegroups.com

i+i instead of i+1

See "Long Similar Variable Names" in How To Write Unmaintainable Code :)
I re-read it from time to time and almost always find things I do wrong there :) 
Reply all
Reply to author
Forward
0 new messages