From 8a13d59385fa45fc2c61b4a935295b890606ebf3 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 22 Nov 2022 00:44:40 +0100 Subject: [PATCH] manager/allocator/cnmallocator: IsAttachmentAllocated: simplify Signed-off-by: Sebastiaan van Stijn --- manager/allocator/cnmallocator/networkallocator.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/manager/allocator/cnmallocator/networkallocator.go b/manager/allocator/cnmallocator/networkallocator.go index ee9ae9b1c1..57455cbb8e 100644 --- a/manager/allocator/cnmallocator/networkallocator.go +++ b/manager/allocator/cnmallocator/networkallocator.go @@ -484,11 +484,7 @@ func (na *cnmNetworkAllocator) DeallocateTask(t *api.Task) error { // IsAttachmentAllocated returns if the passed node and network has resources allocated or not. func (na *cnmNetworkAllocator) IsAttachmentAllocated(node *api.Node, networkAttachment *api.NetworkAttachment) bool { - if node == nil { - return false - } - - if networkAttachment == nil || networkAttachment.Network == nil { + if node == nil || networkAttachment == nil || networkAttachment.Network == nil { return false }