Add missing ==nil check to list diff (#2362)

This isn't triggering any problem in particular, I just noticed it. All
it meant was that noms log might take unnecessarily long with list diff
when there are a lot of changes.
This commit is contained in:
Ben Kalman
2016-08-17 14:44:21 -07:00
committed by GitHub
parent 218c98f209
commit 8a92b75995

View File

@@ -82,7 +82,7 @@ func diffLists(w diffWriter, p types.Path, v1, v2 types.List) (err error) {
if splice.SpRemoved == splice.SpAdded {
// Heuristic: list only has modifications.
for i := uint64(0); i < splice.SpRemoved; i++ {
for i := uint64(0); i < splice.SpRemoved && err == nil; i++ {
lastEl := v1.Get(splice.SpAt + i)
newEl := v2.Get(splice.SpFrom + i)
if shouldDescend(lastEl, newEl) {