Skip to content

Commit f2e2eb0

Browse files
committed
remove unnecessary intermediate variables
1 parent 8f62119 commit f2e2eb0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

digest.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ type Options struct {
3636

3737
// CanDigest checks if the algorithm and qop are supported
3838
func CanDigest(c *Challenge) bool {
39-
algorithm := strings.ToUpper(c.Algorithm)
40-
switch algorithm {
39+
switch strings.ToUpper(c.Algorithm) {
4140
case "", "MD5", "SHA-256", "SHA-512", "SHA-512-256":
4241
default:
4342
return false
@@ -61,8 +60,7 @@ func Digest(chal *Challenge, o Options) (*Credentials, error) {
6160
}
6261
// we re-use the same hash.Hash
6362
var h hash.Hash
64-
algorithm := strings.ToUpper(cred.Algorithm)
65-
switch algorithm {
63+
switch strings.ToUpper(cred.Algorithm) {
6664
case "", "MD5":
6765
h = md5.New()
6866
case "SHA-256":

0 commit comments

Comments
 (0)