Skip to content

优化 pandora key convert - #621

Merged
wonderflow merged 1 commit into
qiniu:masterfrom
redHJ:pandorakeyconvert
Jul 20, 2018
Merged

wonderflow merged 1 commit into
qiniu:masterfrom
redHJ:pandorakeyconvert

Conversation

@redHJ

@redHJ redHJ commented Jul 20, 2018

Copy link
Copy Markdown
Collaborator

Comment thread utils/models/utils.go
func PandoraKey(key string) string {
var nk string
for _, c := range key {
func PandoraKey(key string) (string, bool) {

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.

我觉得加个注释说下这个函数具体是干什么比较好。。

@redHJ
redHJ force-pushed the pandorakeyconvert branch from 609a3e3 to 6a867c7 Compare July 20, 2018 07:04
Comment thread utils/models/utils.go
}
return nk
if valid {
return key, true

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.

这里是true的话不要反回key

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.

性能还能提升

@redHJ
redHJ force-pushed the pandorakeyconvert branch 2 times, most recently from 0b72938 to 07b4d9d Compare July 20, 2018 07:39

func snakeCase(s string) string {
s = models.PandoraKey(s)
s, _ = models.PandoraKey(s)

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.

这里要判断是否为true

@redHJ
redHJ force-pushed the pandorakeyconvert branch from 07b4d9d to ba62dfc Compare July 20, 2018 09:22
@redHJ
redHJ force-pushed the pandorakeyconvert branch from ba62dfc to 61b9c15 Compare July 20, 2018 09:23
@wonderflow

Copy link
Copy Markdown
Contributor

lgtm

@wonderflow
wonderflow merged commit 3ed7660 into qiniu:master Jul 20, 2018
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

⌂ 换网址