mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 10:52:45 +08:00
PERF: use post number to create canoncial path in mega topics.
We don't need page number accuracy in mega topics since it can be expensive.
06d426bd87
This commit is contained in:
parent
227ddb214e
commit
6d17765924
|
@ -122,7 +122,7 @@ class TopicView
|
|||
if @page > 1
|
||||
"?page=#{@page}"
|
||||
else
|
||||
posts_count = unfiltered_posts.where("post_number <= ?", @post_number).count
|
||||
posts_count = is_mega_topic? ? @post_number : unfiltered_posts.where("post_number <= ?", @post_number).count
|
||||
page = ((posts_count - 1) / @limit) + 1
|
||||
page > 1 ? "?page=#{page}" : ""
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user