From 8a92b759958b08361102eeea4c18a7d79248c02f Mon Sep 17 00:00:00 2001 From: Ben Kalman Date: Wed, 17 Aug 2016 14:44:21 -0700 Subject: [PATCH] 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. --- cmd/noms/diff/diff.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/noms/diff/diff.go b/cmd/noms/diff/diff.go index 28be39b33e..8656da6f14 100644 --- a/cmd/noms/diff/diff.go +++ b/cmd/noms/diff/diff.go @@ -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) {