]> Cypherpunks repositories - gostls13.git/commitdiff
net/url: avoid if statement
authorAntonio Murdaca <runcom@redhat.com>
Sun, 26 Jun 2016 10:14:41 +0000 (12:14 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 26 Sep 2016 00:41:28 +0000 (00:41 +0000)
Change-Id: I894a8f49d29dbb6f9265e4b3df5767318b225460
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Reviewed-on: https://go-review.googlesource.com/24492
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/net/url/url.go

index d77e9295ddef28572eba3867a0ce315466f43937..8824c99ddc09c6cce676518c47c6631f8c759046 100644 (file)
@@ -356,10 +356,7 @@ func (u *Userinfo) Username() string {
 
 // Password returns the password in case it is set, and whether it is set.
 func (u *Userinfo) Password() (string, bool) {
-       if u.passwordSet {
-               return u.password, true
-       }
-       return "", false
+       return u.password, u.passwordSet
 }
 
 // String returns the encoded userinfo information in the standard form