I have not read this book, so I can only get away from your quote. I suspect he means the following:
Instead of writing:
array[complicated_expression] = array[complicated_expression] + something_else
(note the two references to the same array index)
You can write:
array[complicated_expression] += something_else
This makes it clear that the compound expression is the same in "both links."
An alternative way to do this is to use a temporary variable:
int index = complicated_expression; array[index] = array[index] + something_else
But this is not so concise. (This, however, is more general, as you can use it for cases when you perform an operation that does not have an X=
operator.)
source share