1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00
Commit Graph

17 Commits

Author SHA1 Message Date
donutloop
b4a49fccfd Slice: Add GroupBy func (#10)
Group by: split slice into two groups, applies on each slice element a
predicate func to categorize this element.

Changes

* Add groub by func
* Add test case for this func
2022-01-02 21:24:56 +08:00
dudaodong
ed4acc1c67 feat: add Shuffle func 2022-01-01 19:18:33 +08:00
dudaodong
042a00296f feat: add FlattenDeep func 2022-01-01 18:14:35 +08:00
dudaodong
b42aac53b3 feat: add Drop func 2022-01-01 17:20:41 +08:00
dudaodong
bb4ac01209 Merge branch 'main' of github.com:duke-git/lancet into main 2021-12-31 10:18:11 +08:00
donutloop
147c1625b5 Slice: Optimize slice func tools (#9)
IntSlice and StringSlice: preallocate memory up front for output slice.
Instead returning a error throw a panic because most likely it's a
programming error.
Contain: rename slice to iterableType and add default case for type
mismatches
2021-12-31 10:15:38 +08:00
dudaodong
2aed55f704 refactor: function in slice.go 2021-12-31 10:12:14 +08:00
donutloop
b106c428ae Every: use int counter (#6)
Use counter to verify all elements passed the perdicate func.
Replace slice of indexes with int counter.
2021-12-29 09:51:50 +08:00
dudaodong
ec983b7aa6 fix: fix
Intersection slice issue
2021-12-28 10:16:53 +08:00
dudaodong
99faeccb05 feat: add Intersection, Union, Without func for slice/slice.go 2021-12-27 19:54:04 +08:00
dudaodong
ad777bc877 feat: add Intersection, Union, Without func for slice/slice.go 2021-12-27 19:47:45 +08:00
dudaodong
589ce7404f refactor: update painc message 2021-12-27 15:12:18 +08:00
Marcel Edmund Franke
578b1bba65 Some: allocate slice to keep track unused indexes is not necessary
Waste of memory for those unused indexes. It got replaced by a simple
boolean to keep track of it.
2021-12-25 13:04:03 +01:00
dudaodong
188d52cd9d feat: add Some and Every function in slice.go 2021-12-09 19:27:20 +08:00
dudaodong
8c8f991390 feat: add Find function in slice.go 2021-12-09 17:54:16 +08:00
dudaodong
f2ed3c6270 test: add some unit test function for convertor, random, slice, and formatter 2021-11-29 17:27:02 +08:00
dudaodong
3254591ab9 publish lancet 2021-11-28 21:28:23 +08:00