Skip to content

stable sort key - #659

Merged
wonderflow merged 1 commit into
qiniu:masterfrom
redHJ:sortKey
Jul 26, 2018
Merged

wonderflow merged 1 commit into
qiniu:masterfrom
redHJ:sortKey

Conversation

@redHJ

@redHJ redHJ commented Jul 26, 2018

Copy link
Copy Markdown
Collaborator

@wonderflow
@unknwon

增加sort key字段进行排序

@@ -3,6 +3,8 @@ package transforms
import (
"fmt"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

多了空行

Comment thread utils/models/models.go
}

func (slice KeyValueSlice) Less(i, j int) bool {
return slice[i].SortKey < slice[j].SortKey

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我看大家都是空值。。这个怎么判断谁先谁后?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

都是空值就保持原来的顺序,稳定排序

@redHJ
redHJ force-pushed the sortKey branch 5 times, most recently from 0aaf81e to 50353cb Compare July 26, 2018 07:03
@unknwon

unknwon commented Jul 26, 2018

Copy link
Copy Markdown
Contributor

LGTM

@redHJ
redHJ force-pushed the sortKey branch 2 times, most recently from afa0ea6 to ca2b1c3 Compare July 26, 2018 08:26
@wonderflow

Copy link
Copy Markdown
Contributor

LGTM

@wonderflow
wonderflow merged commit a76234a into qiniu:master Jul 26, 2018
@redHJ
redHJ deleted the sortKey branch January 24, 2019 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants