SliceTricks: use builtin clear

After filtering without allocating, it's recommended to loop over the underlying slice `a` and setting all unneeded values to `nil` manually if they're to be gc'ed.

Instead, one might simply use the builtin `clear` on the sub-slice starting at the end of `b`.

Change-Id: I25c180bbbccf989ffa0d1fadd54e3a20ff9504c8
GitHub-Last-Rev: ce32262e3ee11baecef0bfd425c8c30096e1e182
GitHub-Pull-Request: golang/wiki#24
Reviewed-on: https://go-review.googlesource.com/c/wiki/+/609517
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Commit-Queue: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
diff --git a/SliceTricks.md b/SliceTricks.md
index 58f7e8f..0f77ff2 100644
--- a/SliceTricks.md
+++ b/SliceTricks.md
@@ -187,9 +187,7 @@
 For elements which must be garbage collected, the following code can be included afterwards:
 
 ```go
-for i := len(b); i < len(a); i++ {
-	a[i] = nil // or the zero value of T
-}
+clear(a[len(b):])
 ```
 
 ### Reversing