hanahmily commented on code in PR #349:
URL: 
https://github.com/apache/skywalking-banyandb/pull/349#discussion_r1379624217


##########
banyand/query/processor_topn.go:
##########
@@ -362,13 +362,8 @@ func (naggr *postNonAggregationProcessor) Val(tagNames 
[]string) []*measurev1.To
                })
        }
 
-       slices.SortStableFunc(topNLists, func(a, b *measurev1.TopNList) bool {
-               if a.GetTimestamp().GetSeconds() < 
b.GetTimestamp().GetSeconds() {
-                       return true
-               } else if a.GetTimestamp().GetSeconds() == 
b.GetTimestamp().GetSeconds() {
-                       return a.GetTimestamp().GetNanos() < 
b.GetTimestamp().GetNanos()
-               }
-               return false
+       slices.SortStableFunc(topNLists, func(a, b *measurev1.TopNList) int {
+               return int(a.GetTimestamp().GetSeconds() - 
b.GetTimestamp().GetSeconds())

Review Comment:
   @lujiajing1126 Please review this update. I need to modify it due to a 
breaking change to the function which is from `golang.org/x/exp` .



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to