Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix off by one error in RelTime #65
This change fixes a user reported issue where the
produces the following output:
LGTM. See inline comment for minor nitpicky suggestion, and below for some background on this change.
sort.Search code used to do
return magnitudes[i].d > diff, before it was changed to use
>= in #26.
I brought up a concern in that PR and made an argument that
> seemed to be more correct/better fitting than
>=. See #26 (comment) specifically, as well as second paragraph of #26 (comment). It looks like my comment got lost there. This PR seems to apply that change now, hence my LGTM.
That said, I'm a little surprised changing
magnitudes[i].D >= diff to
magnitudes[i].D > diff doesn't break any of the existing tests, because it did back when #26 was being reviewed (according to the last paragraph of my comment there):
I can see simply changing this >= to > breaks the other tests. Based on the above, I think the original > here is correct, and tests should be updated to match.
I wonder what happened to those tests...
Me too! :D Wait, do you mean you use the actual "Go" font, the non-monospaced one? I use "Go Mono".
Makes sense; no worries.
Yeah, I started using the non-mono one. We don't have hard line length limitations at work, and go doesn't do very fancy alignment, so I gave it a shot to see how I'd like it. It's not that bad, but it was a pretty big leap to program without a fixed width font. I still used a fixed with font for everything else.
Notably, 3143592 removed
I see, cool. :) As far as I know, Rob Pike uses a non-mono font for coding too. I might give it a try for a longer period of time someday.
Either way, I do enjoy the Go fonts quite a bit (see my mini-review of it here, lol). In addition to my code editor, I also use it on my personal site, and I managed to get it into