Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add groupBy #10

Merged
merged 2 commits into from
Jan 11, 2024
Merged

add groupBy #10

merged 2 commits into from
Jan 11, 2024

Conversation

lxzan
Copy link
Owner

@lxzan lxzan commented Jan 6, 2024

No description provided.

func (c *Vector[K, V]) UniqueByInt64(transfer func(v V) int64) *Vector[K, V] {
*c = algo.UniqueBy(*c, transfer)
return c
}

// GroupByString 通过string类型字段分组
Copy link

Choose a reason for hiding this comment

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

加了这种对基础类型的 shortcut 会不会让编译速度变慢?

Copy link
Owner Author

@lxzan lxzan Jan 6, 2024

Choose a reason for hiding this comment

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

可能会. 我电脑上编译速度就有点慢, 不知道是因为大小核还是泛型, 总体来说可以接受.

Copy link

Choose a reason for hiding this comment

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

fzdwx/iter@5b1791c 我以前也写过这种,就是感觉编译速度太慢了,然后就删除了,后面好了一点

Copy link
Owner Author

Choose a reason for hiding this comment

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

我喜欢泛型, 虽然它尚存不足, vector这个包就是用来补不足的

@lxzan lxzan merged commit f769d89 into main Jan 11, 2024
1 check passed
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.

2 participants