Remove a redundant check

err must be nil at that point.

This also un-indents the success case, so that
it proceeds as a straight-line code.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač 2022-02-22 00:35:21 +01:00
parent a85892a653
commit 7466f0d0df
1 changed files with 74 additions and 76 deletions

View File

@ -813,7 +813,6 @@ func (r *layerStore) Put(id string, parentLayer *Layer, names []string, mountLab
return nil, -1, err
}
}
if err == nil {
layer = &Layer{
ID: id,
Parent: parent,
@ -894,7 +893,6 @@ func (r *layerStore) Put(id string, parentLayer *Layer, names []string, mountLab
return nil, -1, err
}
layer = copyLayer(layer)
}
return layer, size, err
}