Skip to content

Commit ef53634

Browse files
tenfyzhongianding1
authored andcommitted
Get the topics and comanies only once.
1 parent b843d4d commit ef53634

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

autoload/leetcode.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,11 @@ function! leetcode#ListProblems(refresh) abort
443443
let b:leetcode_state = 'All'
444444
let b:leetcode_sort_column = 'id'
445445
let b:leetcode_sort_order = 'asc'
446+
let s:topics_and_companies = py3eval('leetcode.get_topics_and_companies()')
446447
endif
447448

448-
let topics_and_companies = py3eval('leetcode.get_topics_and_companies()')
449-
let topics = topics_and_companies['topics']
450-
let companies = topics_and_companies['companies']
449+
let topics = s:topics_and_companies['topics']
450+
let companies = s:topics_and_companies['companies']
451451

452452
" concatenate the topics into a string
453453
let topic_slugs = map(copy(topics), 'v:val["topic_slug"] . ":" . v:val["num_problems"]')

0 commit comments

Comments
 (0)