refactor: do not do 3 lookups of q in priority
#4664
+4
−3
Merged