Skip to content

Commit

Permalink
Remove CGI.unescape duplication in Store#get
Browse files Browse the repository at this point in the history
  • Loading branch information
vinistock committed Aug 15, 2023
1 parent 5a24001 commit 4336333
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/ruby_lsp/store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ def initialize

sig { params(uri: URI::Generic).returns(Document) }
def get(uri)
path = uri.to_standardized_path
return T.must(@state[T.must(uri.opaque)]) unless path

document = @state[path]
document = @state[uri.storage_key]
return document unless document.nil?

set(uri: uri, source: File.binread(CGI.unescape(path)), version: 0)
path = T.must(uri.to_standardized_path)
set(uri: uri, source: File.binread(path), version: 0)
T.must(@state[path])
end

Expand Down

0 comments on commit 4336333

Please sign in to comment.