Skip to content

Commit fc8dd4e

Browse files
committed
refact: remove useless part
1 parent 488c429 commit fc8dd4e

18 files changed

Lines changed: 231 additions & 614 deletions

File tree

README.md

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,14 @@
1-
Quick Start
1+
# Quick Start
22

33
```shell
44
go get github.com/hyphennn/glamda@latest
55
```
66

7-
```go
8-
package main
9-
10-
import (
11-
"fmt"
12-
13-
"github.com/hyphennn/glamda/gstream"
14-
)
15-
16-
func main() {
17-
s := []int{1, 1, 4, 5, 1, 4, 114514, 0, 0, 0}
18-
s2 := gstream.AsSliceStream(s).Filter(func(i int) bool {
19-
return i%2 == 0
20-
}).Convert(func(i int) int {
21-
return i + 1
22-
}).Sort(func(t1, t2 int) bool {
23-
return t1 < t2
24-
}).Collect()
25-
fmt.Println(s2) // [1 1 1 5 5 114515]
26-
}
27-
```
28-
29-
致力于构建一个 Go Stream API 以及一些常用的泛型、闭包工具,并且不引入任何第三方依赖以及过多的性能消耗
30-
31-
Source of inspiration: Bytedance code.byted.org.lang/gg
32-
33-
This package was not open source when the author resigned, and a similar repository was not found, so this package was
34-
made based on some ideas from the Java Stream API and lang/gg
7+
灵感来源:字节跳动 code.byted.org/lang/gg
358

36-
致力于构建一个 Go Stream API 以及一些常用的泛型、闭包工具,并且不引入任何第三方依赖以及过多的性能消耗
9+
超简易版本的 lang/gg 包, 用于简化一些常用的泛型、闭包工具,并且不引入任何第三方依赖以及过多的性能消耗
3710

38-
灵感来源:字节跳动 code.byted.org/lang/gg
11+
此包在作者离职时仍未开源,也未找到一个类似的仓库,因此基于 lang/gg 的一些思想做了此包,但未使用其 Iter 的做法以及一些 Rust
12+
化的思想,个人觉得没啥意义。
3913

40-
此包在作者离职时仍未开源,也未找到一个类似的仓库,因此基于 Java Stream API 以及 lang/gg 的一些思想做了此包
14+
另:想做一些 Stream API,但调整了很久,还是发现意义不大,因此也没动了,能力有限。

gcollection/disjoint-set/disjoint-set-with-pc.go

Lines changed: 0 additions & 76 deletions
This file was deleted.

gcollection/disjoint-set/disjoint-set.go

Lines changed: 0 additions & 10 deletions
This file was deleted.

gcollection/disjoint-set/factory.go

Lines changed: 0 additions & 12 deletions
This file was deleted.

gcollection/gstack/stack.go

Lines changed: 0 additions & 80 deletions
This file was deleted.

gcollection/gstack/stack_test.go

Lines changed: 0 additions & 39 deletions
This file was deleted.

gconv/conv.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55
package gconv
66

77
import (
8-
"github.com/hyphennn/glambda/internal"
9-
"github.com/hyphennn/glambda/internal/constraints"
8+
"github.com/hyphennn/glambda/gvalue"
109
)
1110

12-
func ToPtr[T constraints.UnPtrAble](t T) *T {
11+
func ToPtr[T any](t T) *T {
1312
return &t
1413
}
1514

16-
func FromPtr[T constraints.UnPtrAble](t *T) T {
15+
func FromPtr[T any](t *T) T {
1716
if t == nil {
18-
return internal.Zero[T]()
17+
return gvalue.Zero[T]()
1918
}
2019
return *t
2120
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/hyphennn/glambda
22

3-
go 1.21
3+
go 1.23

0 commit comments

Comments
 (0)