mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
daemon.setMounts(): copy slice in place
It does not make sense to copy a slice element by element, then discard the source one. Let's do copy in place instead which is way more efficient. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
parent
185ae7eedc
commit
d4c94e83ca
1 changed files with 1 additions and 1 deletions
|
@ -533,7 +533,7 @@ func setMounts(daemon *Daemon, s *specs.Spec, c *container.Container, mounts []c
|
||||||
// - /dev/shm, in case IpcMode is none.
|
// - /dev/shm, in case IpcMode is none.
|
||||||
// While at it, also
|
// While at it, also
|
||||||
// - set size for /dev/shm from shmsize.
|
// - set size for /dev/shm from shmsize.
|
||||||
var defaultMounts []specs.Mount
|
defaultMounts := s.Mounts[:0]
|
||||||
_, mountDev := userMounts["/dev"]
|
_, mountDev := userMounts["/dev"]
|
||||||
for _, m := range s.Mounts {
|
for _, m := range s.Mounts {
|
||||||
if _, ok := userMounts[m.Destination]; ok {
|
if _, ok := userMounts[m.Destination]; ok {
|
||||||
|
|
Loading…
Add table
Reference in a new issue