From 6fe6f45093e63e49819e41b4fb87d7137e7c83c8 Mon Sep 17 00:00:00 2001 From: Robert Swain <rob@matrix.org> Date: Mon, 22 May 2017 14:13:57 +0200 Subject: [PATCH] mediaapi/writers: Remove unnecessary comparison to true --- src/github.com/matrix-org/dendrite/mediaapi/writers/download.go | 2 +- src/github.com/matrix-org/dendrite/mediaapi/writers/upload.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go b/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go index eed3bb8a7..4c682ce99 100644 --- a/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go +++ b/src/github.com/matrix-org/dendrite/mediaapi/writers/download.go @@ -347,7 +347,7 @@ func (r *downloadRequest) commitFileAndMetadata(tmpDir types.Path, absBasePath t r.Logger.WithError(err).Error("Failed to move file.") return updateActiveRemoteRequests } - if duplicate == true { + if duplicate { r.Logger.WithField("dst", finalPath).Info("File was stored previously - discarding duplicate") // Continue on to store the metadata in the database } diff --git a/src/github.com/matrix-org/dendrite/mediaapi/writers/upload.go b/src/github.com/matrix-org/dendrite/mediaapi/writers/upload.go index 497cae79e..f8e635ece 100644 --- a/src/github.com/matrix-org/dendrite/mediaapi/writers/upload.go +++ b/src/github.com/matrix-org/dendrite/mediaapi/writers/upload.go @@ -151,7 +151,7 @@ func storeFileAndMetadata(tmpDir types.Path, absBasePath types.Path, mediaMetada JSON: jsonerror.Unknown(fmt.Sprintf("Failed to upload")), } } - if duplicate == true { + if duplicate { logger.WithField("dst", finalPath).Info("File was stored previously - discarding duplicate") }