2 ms·
You normally fix that not with the GC itself, but with the compiler. If new Object() truly doesn't have any effects visible other than the valid reference, the
by monocasa 3y ago
You normally fix that not with the GC itself, but with the compiler.
If new Object() truly doesn't have any effects visible other than the valid reference, then it's creation can be moved to after the if statement.