@@ -175,6 +175,21 @@ func (slice intSlice) TakeWhile(functors ...intFunctorForFilter) intSlice {
175
175
return tmpSlice
176
176
}
177
177
178
+ //TakeWhilePtr - Returns a new list based on predicate function. It returns new list once condition fails.
179
+ func (slice intSlicePtr ) TakeWhilePtr (functors ... intFunctorForFilterPtr ) intSlicePtr {
180
+
181
+ tmpSlice := slice
182
+
183
+ for _ , f := range functors {
184
+ if f == nil {
185
+ continue
186
+ }
187
+ tmpSlice = TakeWhileIntPtr (f , tmpSlice )
188
+ }
189
+
190
+ return tmpSlice
191
+ }
192
+
178
193
type int64Slice []int64
179
194
type int64FunctorForMap func (int64 ) int64
180
195
type int64FunctorForFilter func (int64 ) bool
@@ -350,6 +365,21 @@ func (slice int64Slice) TakeWhile(functors ...int64FunctorForFilter) int64Slice
350
365
return tmpSlice
351
366
}
352
367
368
+ //TakeWhilePtr - Returns a new list based on predicate function. It returns new list once condition fails.
369
+ func (slice int64SlicePtr ) TakeWhilePtr (functors ... int64FunctorForFilterPtr ) int64SlicePtr {
370
+
371
+ tmpSlice := slice
372
+
373
+ for _ , f := range functors {
374
+ if f == nil {
375
+ continue
376
+ }
377
+ tmpSlice = TakeWhileInt64Ptr (f , tmpSlice )
378
+ }
379
+
380
+ return tmpSlice
381
+ }
382
+
353
383
type int32Slice []int32
354
384
type int32FunctorForMap func (int32 ) int32
355
385
type int32FunctorForFilter func (int32 ) bool
@@ -525,6 +555,21 @@ func (slice int32Slice) TakeWhile(functors ...int32FunctorForFilter) int32Slice
525
555
return tmpSlice
526
556
}
527
557
558
+ //TakeWhilePtr - Returns a new list based on predicate function. It returns new list once condition fails.
559
+ func (slice int32SlicePtr ) TakeWhilePtr (functors ... int32FunctorForFilterPtr ) int32SlicePtr {
560
+
561
+ tmpSlice := slice
562
+
563
+ for _ , f := range functors {
564
+ if f == nil {
565
+ continue
566
+ }
567
+ tmpSlice = TakeWhileInt32Ptr (f , tmpSlice )
568
+ }
569
+
570
+ return tmpSlice
571
+ }
572
+
528
573
type int16Slice []int16
529
574
type int16FunctorForMap func (int16 ) int16
530
575
type int16FunctorForFilter func (int16 ) bool
@@ -700,6 +745,21 @@ func (slice int16Slice) TakeWhile(functors ...int16FunctorForFilter) int16Slice
700
745
return tmpSlice
701
746
}
702
747
748
+ //TakeWhilePtr - Returns a new list based on predicate function. It returns new list once condition fails.
749
+ func (slice int16SlicePtr ) TakeWhilePtr (functors ... int16FunctorForFilterPtr ) int16SlicePtr {
750
+
751
+ tmpSlice := slice
752
+
753
+ for _ , f := range functors {
754
+ if f == nil {
755
+ continue
756
+ }
757
+ tmpSlice = TakeWhileInt16Ptr (f , tmpSlice )
758
+ }
759
+
760
+ return tmpSlice
761
+ }
762
+
703
763
type int8Slice []int8
704
764
type int8FunctorForMap func (int8 ) int8
705
765
type int8FunctorForFilter func (int8 ) bool
@@ -875,6 +935,21 @@ func (slice int8Slice) TakeWhile(functors ...int8FunctorForFilter) int8Slice {
875
935
return tmpSlice
876
936
}
877
937
938
+ //TakeWhilePtr - Returns a new list based on predicate function. It returns new list once condition fails.
939
+ func (slice int8SlicePtr ) TakeWhilePtr (functors ... int8FunctorForFilterPtr ) int8SlicePtr {
940
+
941
+ tmpSlice := slice
942
+
943
+ for _ , f := range functors {
944
+ if f == nil {
945
+ continue
946
+ }
947
+ tmpSlice = TakeWhileInt8Ptr (f , tmpSlice )
948
+ }
949
+
950
+ return tmpSlice
951
+ }
952
+
878
953
type uintSlice []uint
879
954
type uintFunctorForMap func (uint ) uint
880
955
type uintFunctorForFilter func (uint ) bool
@@ -1050,6 +1125,21 @@ func (slice uintSlice) TakeWhile(functors ...uintFunctorForFilter) uintSlice {
1050
1125
return tmpSlice
1051
1126
}
1052
1127
1128
+ //TakeWhilePtr - Returns a new list based on predicate function. It returns new list once condition fails.
1129
+ func (slice uintSlicePtr ) TakeWhilePtr (functors ... uintFunctorForFilterPtr ) uintSlicePtr {
1130
+
1131
+ tmpSlice := slice
1132
+
1133
+ for _ , f := range functors {
1134
+ if f == nil {
1135
+ continue
1136
+ }
1137
+ tmpSlice = TakeWhileUintPtr (f , tmpSlice )
1138
+ }
1139
+
1140
+ return tmpSlice
1141
+ }
1142
+
1053
1143
type uint64Slice []uint64
1054
1144
type uint64FunctorForMap func (uint64 ) uint64
1055
1145
type uint64FunctorForFilter func (uint64 ) bool
@@ -1225,6 +1315,21 @@ func (slice uint64Slice) TakeWhile(functors ...uint64FunctorForFilter) uint64Sli
1225
1315
return tmpSlice
1226
1316
}
1227
1317
1318
+ //TakeWhilePtr - Returns a new list based on predicate function. It returns new list once condition fails.
1319
+ func (slice uint64SlicePtr ) TakeWhilePtr (functors ... uint64FunctorForFilterPtr ) uint64SlicePtr {
1320
+
1321
+ tmpSlice := slice
1322
+
1323
+ for _ , f := range functors {
1324
+ if f == nil {
1325
+ continue
1326
+ }
1327
+ tmpSlice = TakeWhileUint64Ptr (f , tmpSlice )
1328
+ }
1329
+
1330
+ return tmpSlice
1331
+ }
1332
+
1228
1333
type uint32Slice []uint32
1229
1334
type uint32FunctorForMap func (uint32 ) uint32
1230
1335
type uint32FunctorForFilter func (uint32 ) bool
@@ -1400,6 +1505,21 @@ func (slice uint32Slice) TakeWhile(functors ...uint32FunctorForFilter) uint32Sli
1400
1505
return tmpSlice
1401
1506
}
1402
1507
1508
+ //TakeWhilePtr - Returns a new list based on predicate function. It returns new list once condition fails.
1509
+ func (slice uint32SlicePtr ) TakeWhilePtr (functors ... uint32FunctorForFilterPtr ) uint32SlicePtr {
1510
+
1511
+ tmpSlice := slice
1512
+
1513
+ for _ , f := range functors {
1514
+ if f == nil {
1515
+ continue
1516
+ }
1517
+ tmpSlice = TakeWhileUint32Ptr (f , tmpSlice )
1518
+ }
1519
+
1520
+ return tmpSlice
1521
+ }
1522
+
1403
1523
type uint16Slice []uint16
1404
1524
type uint16FunctorForMap func (uint16 ) uint16
1405
1525
type uint16FunctorForFilter func (uint16 ) bool
@@ -1575,6 +1695,21 @@ func (slice uint16Slice) TakeWhile(functors ...uint16FunctorForFilter) uint16Sli
1575
1695
return tmpSlice
1576
1696
}
1577
1697
1698
+ //TakeWhilePtr - Returns a new list based on predicate function. It returns new list once condition fails.
1699
+ func (slice uint16SlicePtr ) TakeWhilePtr (functors ... uint16FunctorForFilterPtr ) uint16SlicePtr {
1700
+
1701
+ tmpSlice := slice
1702
+
1703
+ for _ , f := range functors {
1704
+ if f == nil {
1705
+ continue
1706
+ }
1707
+ tmpSlice = TakeWhileUint16Ptr (f , tmpSlice )
1708
+ }
1709
+
1710
+ return tmpSlice
1711
+ }
1712
+
1578
1713
type uint8Slice []uint8
1579
1714
type uint8FunctorForMap func (uint8 ) uint8
1580
1715
type uint8FunctorForFilter func (uint8 ) bool
@@ -1750,6 +1885,21 @@ func (slice uint8Slice) TakeWhile(functors ...uint8FunctorForFilter) uint8Slice
1750
1885
return tmpSlice
1751
1886
}
1752
1887
1888
+ //TakeWhilePtr - Returns a new list based on predicate function. It returns new list once condition fails.
1889
+ func (slice uint8SlicePtr ) TakeWhilePtr (functors ... uint8FunctorForFilterPtr ) uint8SlicePtr {
1890
+
1891
+ tmpSlice := slice
1892
+
1893
+ for _ , f := range functors {
1894
+ if f == nil {
1895
+ continue
1896
+ }
1897
+ tmpSlice = TakeWhileUint8Ptr (f , tmpSlice )
1898
+ }
1899
+
1900
+ return tmpSlice
1901
+ }
1902
+
1753
1903
type stringSlice []string
1754
1904
type stringFunctorForMap func (string ) string
1755
1905
type stringFunctorForFilter func (string ) bool
@@ -1925,6 +2075,21 @@ func (slice stringSlice) TakeWhile(functors ...stringFunctorForFilter) stringSli
1925
2075
return tmpSlice
1926
2076
}
1927
2077
2078
+ //TakeWhilePtr - Returns a new list based on predicate function. It returns new list once condition fails.
2079
+ func (slice stringSlicePtr ) TakeWhilePtr (functors ... stringFunctorForFilterPtr ) stringSlicePtr {
2080
+
2081
+ tmpSlice := slice
2082
+
2083
+ for _ , f := range functors {
2084
+ if f == nil {
2085
+ continue
2086
+ }
2087
+ tmpSlice = TakeWhileStrPtr (f , tmpSlice )
2088
+ }
2089
+
2090
+ return tmpSlice
2091
+ }
2092
+
1928
2093
type boolSlice []bool
1929
2094
type boolFunctorForMap func (bool ) bool
1930
2095
type boolFunctorForFilter func (bool ) bool
@@ -2100,6 +2265,21 @@ func (slice boolSlice) TakeWhile(functors ...boolFunctorForFilter) boolSlice {
2100
2265
return tmpSlice
2101
2266
}
2102
2267
2268
+ //TakeWhilePtr - Returns a new list based on predicate function. It returns new list once condition fails.
2269
+ func (slice boolSlicePtr ) TakeWhilePtr (functors ... boolFunctorForFilterPtr ) boolSlicePtr {
2270
+
2271
+ tmpSlice := slice
2272
+
2273
+ for _ , f := range functors {
2274
+ if f == nil {
2275
+ continue
2276
+ }
2277
+ tmpSlice = TakeWhileBoolPtr (f , tmpSlice )
2278
+ }
2279
+
2280
+ return tmpSlice
2281
+ }
2282
+
2103
2283
type float32Slice []float32
2104
2284
type float32FunctorForMap func (float32 ) float32
2105
2285
type float32FunctorForFilter func (float32 ) bool
@@ -2275,6 +2455,21 @@ func (slice float32Slice) TakeWhile(functors ...float32FunctorForFilter) float32
2275
2455
return tmpSlice
2276
2456
}
2277
2457
2458
+ //TakeWhilePtr - Returns a new list based on predicate function. It returns new list once condition fails.
2459
+ func (slice float32SlicePtr ) TakeWhilePtr (functors ... float32FunctorForFilterPtr ) float32SlicePtr {
2460
+
2461
+ tmpSlice := slice
2462
+
2463
+ for _ , f := range functors {
2464
+ if f == nil {
2465
+ continue
2466
+ }
2467
+ tmpSlice = TakeWhileFloat32Ptr (f , tmpSlice )
2468
+ }
2469
+
2470
+ return tmpSlice
2471
+ }
2472
+
2278
2473
type float64Slice []float64
2279
2474
type float64FunctorForMap func (float64 ) float64
2280
2475
type float64FunctorForFilter func (float64 ) bool
@@ -2449,3 +2644,18 @@ func (slice float64Slice) TakeWhile(functors ...float64FunctorForFilter) float64
2449
2644
2450
2645
return tmpSlice
2451
2646
}
2647
+
2648
+ //TakeWhilePtr - Returns a new list based on predicate function. It returns new list once condition fails.
2649
+ func (slice float64SlicePtr ) TakeWhilePtr (functors ... float64FunctorForFilterPtr ) float64SlicePtr {
2650
+
2651
+ tmpSlice := slice
2652
+
2653
+ for _ , f := range functors {
2654
+ if f == nil {
2655
+ continue
2656
+ }
2657
+ tmpSlice = TakeWhileFloat64Ptr (f , tmpSlice )
2658
+ }
2659
+
2660
+ return tmpSlice
2661
+ }
0 commit comments