Use []pullRefName instead of []*pullRefName

We are passing the values, don't really need the pointer sharing semantics,
and the structures are small enough, and the arrays short enough,
that we very likely lose on the indirect accesses more than we save on
quicker copying of the slices when extending them.  Value semantics
is safer anyway.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1176
Approved by: rhatdan
This commit is contained in:
Miloslav Trmač
2018-07-28 05:23:20 +02:00
committed by Atomic Bot
parent 83f40de965
commit dae6200662
2 changed files with 14 additions and 14 deletions

View File

@ -73,7 +73,7 @@ func TestGetPullRefName(t *testing.T) {
require.NoError(t, err, c.srcName)
res := getPullRefName(srcRef, c.destName)
assert.Equal(t, &pullRefName{image: c.expectedImage, srcRef: srcRef, dstName: c.expectedDstName}, res,
assert.Equal(t, pullRefName{image: c.expectedImage, srcRef: srcRef, dstName: c.expectedDstName}, res,
fmt.Sprintf("%#v %#v", c.srcName, c.destName))
}
}
@ -180,7 +180,7 @@ func TestRefNamesFromImageReference(t *testing.T) {
require.NoError(t, err, c.srcName)
require.Len(t, res, len(c.expected), c.srcName)
for i, e := range c.expected {
assert.Equal(t, &pullRefName{image: e.image, srcRef: srcRef, dstName: e.dstName}, res[i], fmt.Sprintf("%s #%d", c.srcName, i))
assert.Equal(t, pullRefName{image: e.image, srcRef: srcRef, dstName: e.dstName}, res[i], fmt.Sprintf("%s #%d", c.srcName, i))
}
}
}