This is a tiny one.
Often we want to perform a SELECT with side effects, and don’t care what is returned.
We can exploit the HAVING clause to do this, rather than allocate the memory and clear it.
The old way (works and is explicit, but we can do better):
NoNeed = SELECT s FROM G:s-(:e)->:t
ACCUM @@allE += e;
NoNeed.clear(); // We allocated it, and now we clear it
The sneakier (and I think better) way:
NoNeed = SELECT s FROM G:s-(:e)->:t
ACCUM @@allE += e;
HAVING 1==0;
See what we did there? The having clause prevents anything from being returned to the output vertex set, and so we avoid allocating memory only to have to clear it later.