mirror of
https://github.com/containers/podman.git
synced 2025-08-02 09:12:36 +08:00
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:

committed by
Atomic Bot

parent
83f40de965
commit
dae6200662
@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user