Skip to content

Commit

Permalink
add unsafe{...} for latest v (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
shove70 authored Dec 28, 2023
1 parent 583aad0 commit b59edea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions analyzer/psi/StubIndex.v
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ pub fn new_stubs_index(sinks []StubIndexSink) &StubIndex {
mut index := &StubIndex{
sinks: sinks
module_to_files: map[string][]StubIndexSink{}
all_elements_by_modules: [psi.count_stub_index_location_keys]map[string][]PsiElement{}
types_by_modules: [psi.count_stub_index_location_keys]map[string][]PsiElement{}
all_elements_by_modules: unsafe { [psi.count_stub_index_location_keys]map[string][]PsiElement{} }
types_by_modules: unsafe { [psi.count_stub_index_location_keys]map[string][]PsiElement{} }
}

for i in 0 .. psi.count_stub_index_location_keys {
Expand All @@ -62,7 +62,7 @@ pub fn new_stubs_index(sinks []StubIndexSink) &StubIndex {
}

pub fn (mut s StubIndex) sub_indexes_from_sink(sink StubIndexSink) {
s.module_to_files[sink.stub_list.module_fqn] << sink
unsafe { s.module_to_files[sink.stub_list.module_fqn] << sink }
s.file_to_module[sink.stub_list.path] = sink.stub_list.module_fqn
}

Expand Down Expand Up @@ -104,7 +104,7 @@ pub fn (mut s StubIndex) update_index_from_sink(sink StubIndexSink) {
}
}

mut data_by_name := mp[name]
mut data_by_name := unsafe { mp[name] }
data_by_name.stubs << stubs_result
data_by_name.psis << psi_result
mp[name] = data_by_name
Expand Down

0 comments on commit b59edea

Please sign in to comment.