SliceTricks
Russ Cox edited this page 2023-12-14 22:14:45 -05:00

Wiki Page Revisions

81 Commits

Author SHA1 Message Date
Russ Cox
b0657ab84c wiki: redirect everything to go.dev/wiki
For #61940.
2023-12-14 22:14:45 -05:00
Tim Rosenblatt
786ba4b382 Adds clarity on how deleting elements from a slice can cause a memory leak thanks to the underlying array 2023-08-10 16:37:58 -07:00
Nate
33793edcc2 added reference to golang.org/x/exp/slices 2023-01-10 13:59:08 -05:00
Duncan Harris
e832d1d424 Add "Extend Capacity" 2022-03-30 11:23:46 +01:00
Jeremy Chase
46d01ae2a1 Clarify Expand and Extend 2022-03-04 14:46:45 -05:00
Sean Liao
6fe9f52ac7 fix godoc.org / pkg.go.dev links 2022-01-22 16:52:18 +01:00
Ian Lance Taylor
d970f7f1f8 Revert f6920aaaf866d0e331b12fad4ee530079113b97f...75c3834c6757470db4b2507a742a18df4206efb6 on SliceTricks 2021-09-13 11:11:10 -07:00
litbear
75c3834c67 It maybe a typo 2021-09-13 10:47:21 +08:00
Andrew Field
f6920aaaf8 I think there should be a colon ' : ' 2021-05-26 20:08:09 +03:00
Go101
96c559eddd Updated SliceTricks (markdown) 2021-05-24 08:50:10 -04:00
Go101
ee9fc72909 Updated SliceTricks (markdown) 2021-05-24 08:48:46 -04:00
Go101
404f1a2952 Updated SliceTricks (markdown) 2021-05-24 08:46:11 -04:00
Ian Lance Taylor
c1e98874f6 tipo 2021-05-09 20:16:42 -07:00
Go101
ebf9e50491 Updated SliceTricks (markdown) 2021-05-09 12:12:40 -04:00
Go101
10042f7dbc Updated SliceTricks (markdown) 2021-05-09 12:12:02 -04:00
yarcat
bffe6342c2 Fix moveToFront and its headline 2021-02-12 18:48:16 +01:00
Go101
14c2c2dbed Updated SliceTricks (markdown) 2020-12-30 10:45:10 -05:00
Go101
1265d4d8ab Updated SliceTricks (markdown) 2020-12-30 10:43:51 -05:00
nishanths
2df8a1b381 remove stray code in Insert section 2020-11-20 22:52:54 +05:30
Go101
7cbd64a77f Updated SliceTricks (markdown) 2020-09-07 05:35:13 -04:00
Martin Möhrmann
b120de74c8 remove append based slice copy patterns that are slower since go1.15 than make+copy 2020-09-06 20:37:02 +02:00
Ian Lance Taylor
93fa5681d0 Revert e5998399c87e9f2de47e5108df584283db3c7fbd...46fe561befe97672f770640f831a9a545c77e540 on SliceTricks 2020-06-08 13:19:47 -07:00
Wei Zhang
46fe561bef batch slice cap should be actions divided by batchSize and plus one for remainder (added braces for clarity) 2020-06-08 21:10:44 +01:00
Tim Heckman
e5998399c8 Add a sliding window function as shared here: https://gophers.slack.com/archives/C02A8LZKT/p1588980407253800 2020-05-08 16:37:16 -07:00
Tom Payne
beefa9fe4e Updated SliceTricks (markdown) 2020-05-04 19:00:44 +01:00
Tom Payne
b02b191bbf Updated SliceTricks (markdown) 2020-05-04 18:59:55 +01:00
Kent Hagerman
7f4b67adb2 Ordered delete's check for `i<len(a)-1` is unnecessary. Slicing an n-length array using `[n:]` will return an empty array, and so the copy will do nothing. 2020-04-15 13:32:10 -04:00
Bator Tsyrendylykov
a87dff31b0 once memory allocation for batches 2020-01-15 11:58:54 +03:00
Ian Lance Taylor
93323a81f6 Revert d28c2eed0adc1a35d49bd3446ec51646c3fd547a...7c1079779440dc52877765bc0a548c24a8ea0cbc on SliceTricks 2019-11-12 07:53:09 -08:00
Navid Kalaei
7c10797794 fix: correct boundary checking for deleting an element 2019-11-12 16:00:20 +03:30
Navid Kalaei
daccf419a0 fix: do not delete last element if target index is out of range 2019-11-12 15:51:46 +03:30
Sergey Kozlov
d28c2eed0a rolled back the error of the previous author 2019-10-23 16:40:28 +06:00
steperdin
0265ec0d71 Revert ce4831f778585d51acfceb4ef649140bab6f4ed8...8babc3774c86d1ce85e8a3e8fd49cfc7473ecafd on SliceTricks 2019-10-23 13:08:35 +03:00
Andrew Makhnev
8babc3774c Revert 2d00790e7472e753c006e3d1c14327209ebf9879...ce4831f778585d51acfceb4ef649140bab6f4ed8 on SliceTricks 2019-10-23 13:02:59 +03:00
Andrew Makhnev
ce4831f778 fix typo 2019-10-23 12:55:10 +03:00
Bogdan
2d00790e74 Fix panic if i is last element for delete 2019-10-15 10:12:33 +02:00
Tom Payne
2f2dcdeec7 Add Filter (in place) 2019-07-30 10:48:59 +02:00
Tim Schindler
f928b4c0a4 Updated Slice Tricks (markdown) 2019-04-18 18:07:02 +02:00
Tim Schindler
2de9b8af55 Updated SliceTricks (markdown) 2019-04-18 17:52:01 +02:00
Anaminus
15b8fbe8bd In filter trick, include code that handles garbage collected elements. 2019-02-14 17:59:35 +00:00
Thomas Mangin
bc97e754b5 As the examples are about performance, perform the mininal work required 2018-12-31 17:41:42 +00:00
Maxim Litvinov
3941028dc4 Revert 9ade7aa9a7572213f24774347587a453ea88c3e9...3ddd17034b922e41c0d0b8ec85f71dfc813a1992 on SliceTricks 2018-12-31 09:12:50 +02:00
Maxim Litvinov
3ddd17034b woops. revert last edit. 2018-12-31 09:11:06 +02:00
Maxim Litvinov
fdf5588096 remove garbage. 2018-12-31 09:08:09 +02:00
Maxim Litvinov
9ade7aa9a7 sort Pushes & Pops. 2018-12-31 09:03:58 +02:00
Maxim Litvinov
f1e07061fb "Pop" in Stack/LIFO supposed to be opposite of "Push", not of "Push Front". 2018-12-31 09:00:22 +02:00
Ian Lance Taylor
c69144a8ce For issue #29436 2018-12-27 14:17:54 -08:00
Adam DiCarlo
d8e8a7f56c Clarify in-place deduplicate, after having being bitten by copying all-but-print statement 2018-10-18 13:10:48 -07:00
Eugene Russkikh
3ba038cc99 Updated SliceTricks (markdown) 2018-10-02 22:40:17 +02:00
Meng Zhuo
b9434c8435 add in place deduplicate trick 2018-09-28 14:32:34 +08:00