From 4df8d2ba04be71bb997a71c684c0b855e25f5461 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 3 Feb 2011 08:28:47 -0800 Subject: [PATCH] Use switch, not ifs. --- server/go/blobserver/localdisk.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server/go/blobserver/localdisk.go b/server/go/blobserver/localdisk.go index f74bf3383..8445ec735 100644 --- a/server/go/blobserver/localdisk.go +++ b/server/go/blobserver/localdisk.go @@ -45,14 +45,15 @@ func (ds *diskStorage) Remove(partition string, blobs []*blobref.BlobRef) os.Err for _, blob := range blobs { fileName := PartitionBlobFileName(partition, blob) err := os.Remove(fileName) - if err == nil { - continue; - } - if errorIsNoEnt(err) { + switch { + case err == nil: + continue + case errorIsNoEnt(err): log.Printf("Deleting already-deleted file; harmless.") continue + default: + return err } - return err } return nil }