Skip to content
Snippets Groups Projects
Closed Redundant variable assignment logic in symbol search
  • View options
  • Redundant variable assignment logic in symbol search

  • View options
  • Closed Issue created by Warren Gifford

    Created by: blanet

    File cmd/frontend/graphqlbackend/search_symbols.go has always assigned commit.inputRev, there are no need to do this again below(L184, L187).

    commit := &gitCommitResolver{
    	repo:     &repositoryResolver{repo: repoRevs.Repo},
    	oid:      gitObjectID(commitID),
    	inputRev: &inputRev,
    	// NOTE: Not all fields are set, for performance.
    }
    if inputRev != "" {
    	commit.inputRev = &inputRev
    }

    https://github.com/sourcegraph/sourcegraph/blob/9f05d2bf635f49ad6915bca703112e1caf612034/cmd/frontend/graphqlbackend/search_symbols.go#L181-L189

    Activity

    • All activity
    • Comments only
    • History only
    • Newest first
    • Oldest first