Closed raltnoeder closed 5 years ago
I like 8c67b0876e2381af3c91647877e0e0b3180c0b96. It's obviously cleaner and cherry-picking it alone produces the best benchmark test results. Please make a PR of it alone against the development branch and I'll accept it.
I personally don't prefer 3f6ebd6ad799602849ecd8cc85b3830c8e0e5faa. While it's not common, I think that handling a special or end state case of a while loop with loop variables directly after the loop terminates is appropriate here. Here's an example from the standard library that I think is really nice: https://golang.org/src/sort/sort.go?s=6884:6908#L489
I'd rather keep it this way than having even moderately branching code as I tend to try to follow the recommendations in this article when and where I can: https://medium.com/@matryer/line-of-sight-in-code-186dd7cdea88
Also, @rck? should we do away with the development master split? It's different than our other projects and consistency is good. I'll leave that up to you!
Ok, sounds good, I'll open another pull request with 8c67b08 for you to merge
Thanks, then I close this one.
Commit
8c67b0876e2381af3c91647877e0e0b3180c0b96
avoids a duplicate map lookup. Should probably be applied.Commit
3f6ebd6ad799602849ecd8cc85b3830c8e0e5faa
restructures code, avoiding some code duplication for a special case. Low importance, this may be a somewhat cleaner solution than the existing one.