Skip to content

Commit

Permalink
removed unnecessary ToSlash usage for URI
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-kuklin committed Apr 25, 2021
1 parent 27c804c commit 67a3ccd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/lsp/cache/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -1279,13 +1279,12 @@ func contains(views []*View, view *View) bool {
}

func inVendor(uri span.URI) bool {
toSlash := filepath.ToSlash(string(uri))
if !strings.Contains(toSlash, "/vendor/") {
if !strings.Contains(string(uri), "/vendor/") {
return false
}
// Only packages in _subdirectories_ of /vendor/ are considered vendored
// (/vendor/a/foo.go is vendored, /vendor/foo.go is not).
split := strings.Split(toSlash, "/vendor/")
split := strings.Split(string(uri), "/vendor/")
if len(split) < 2 {
return false
}
Expand Down

0 comments on commit 67a3ccd

Please sign in to comment.