Skip to content

Commit b0cd3b8

Browse files
mueslilunny
authored andcommitted
Fixed ineffectual assignments (#7555)
Don't assign values we never use.
1 parent 9a96503 commit b0cd3b8

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

models/git_diff.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ func ParsePatch(maxLines, maxLineCharacters, maxFiles int, reader io.Reader) (*D
543543

544544
// Get new file.
545545
if strings.HasPrefix(line, cmdDiffHead) {
546-
middle := -1
546+
var middle int
547547

548548
// Note: In case file name is surrounded by double quotes (it happens only in git-shell).
549549
// e.g. diff --git "a/xxx" "b/xxx"

routers/user/setting/security_twofa.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ func twofaGenerateSecretAndQr(ctx *context.Context) bool {
8181
// Filter unsafe character ':' in issuer
8282
issuer := strings.Replace(setting.AppName+" ("+setting.Domain+")", ":", "", -1)
8383
if otpKey == nil {
84-
err = nil // clear the error, in case the URL was invalid
8584
otpKey, err = totp.Generate(totp.GenerateOpts{
8685
SecretSize: 40,
8786
Issuer: issuer,

0 commit comments

Comments
 (0)