hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit bea5feb34d5944e6dfc87dd292a85d100573397a
parent 99a18b21fcc2523015c071b8915cae00a83842b5
Author: bep <bjorn.erik.pedersen@gmail.com>
Date:   Fri,  3 Apr 2015 21:16:36 +0200

Return early from DistinctErrorLogger's Printf

Diffstat:
Mhelpers/general.go | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/helpers/general.go b/helpers/general.go
@@ -162,11 +162,12 @@ type DistinctErrorLogger struct {
 func (l *DistinctErrorLogger) Printf(format string, v ...interface{}) {
 	logStatement := fmt.Sprintf(format, v...)
 	l.RLock()
-	logged := l.m[logStatement]
-	l.RUnlock()
-	if logged {
+	if l.m[logStatement] {
+		l.RUnlock()
 		return
 	}
+	l.RUnlock()
+
 	l.Lock()
 	if !l.m[logStatement] {
 		jww.ERROR.Print(logStatement)