We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e1aaaf commit 555d133Copy full SHA for 555d133
golink.go
@@ -221,15 +221,15 @@ func serveHome(w http.ResponseWriter, short string) {
221
}
222
stats.mu.Unlock()
223
224
- if len(clicks) > 200 {
225
- clicks = clicks[:200]
226
- }
227
sort.Slice(clicks, func(i, j int) bool {
228
if clicks[i].NumClicks != clicks[j].NumClicks {
229
return clicks[i].NumClicks > clicks[j].NumClicks
230
231
return clicks[i].Short < clicks[j].Short
232
})
+ if len(clicks) > 200 {
+ clicks = clicks[:200]
+ }
233
234
homeTmpl.Execute(w, homeData{
235
Short: short,
0 commit comments